From 224b89f8db4fb677cc597c55256715e2d9af3664 Mon Sep 17 00:00:00 2001 From: Naga Raju Pasunuri Date: Thu, 18 May 2023 19:57:11 +0530 Subject: [PATCH 01/16] Added - Changes for setting resource ID in state file before workrequest completion --- .../adm/adm_knowledge_base_resource.go | 17 ++++++ ..._detection_ai_private_endpoint_resource.go | 17 ++++++ .../ai_anomaly_detection_model_resource.go | 5 ++ .../ai_vision/ai_vision_model_resource.go | 5 ++ .../ai_vision/ai_vision_project_resource.go | 5 ++ .../analytics_analytics_instance_resource.go | 5 ++ .../apigateway/apigateway_api_resource.go | 5 ++ .../apigateway_certificate_resource.go | 5 ++ .../apigateway_deployment_resource.go | 5 ++ .../apigateway/apigateway_gateway_resource.go | 5 ++ .../apigateway_subscriber_resource.go | 5 ++ .../apigateway_usage_plan_resource.go | 5 ++ .../service/apm/apm_apm_domain_resource.go | 17 ++++++ ...trol_monitor_plugin_management_resource.go | 17 ++++++ .../bastion/bastion_bastion_resource.go | 5 ++ .../bastion/bastion_session_resource.go | 5 ++ .../service/bds/bds_bds_instance_resource.go | 17 ++++++ ...blockchain_blockchain_platform_resource.go | 17 ++++++ .../cloud_bridge_agent_dependency_resource.go | 17 ++++++ .../cloud_bridge_asset_source_resource.go | 5 ++ .../cloud_bridge_inventory_resource.go | 17 ++++++ .../cloud_guard_data_source_resource.go | 17 ++++++ ...oud_migrations_migration_asset_resource.go | 5 ++ ...loud_migrations_migration_plan_resource.go | 5 ++ ...igrations_replication_schedule_resource.go | 5 ++ .../cloud_migrations_target_asset_resource.go | 5 ++ ...r_instances_container_instance_resource.go | 5 ++ ...tainerengine_virtual_node_pool_resource.go | 17 ++++++ ...e_compute_capacity_reservation_resource.go | 7 ++- .../core/core_dedicated_vm_host_resource.go | 8 ++- internal/service/core/core_image_resource.go | 8 ++- .../core_instance_pool_instance_resource.go | 4 +- .../service/core/core_instance_resource.go | 7 +++ .../data_labeling_service_dataset_resource.go | 5 ++ ...a_safe_audit_archive_retrieval_resource.go | 5 ++ .../data_safe_audit_policy_resource.go | 17 ++++++ .../data_safe_audit_profile_resource.go | 17 ++++++ .../data_safe_audit_trail_resource.go | 17 ++++++ ...a_safe_data_safe_configuration_resource.go | 18 ++++++ ...afe_data_safe_private_endpoint_resource.go | 5 ++ .../data_safe_discovery_job_resource.go | 5 ++ ...ta_safe_library_masking_format_resource.go | 5 ++ .../data_safe_masking_policy_resource.go | 5 ++ .../data_safe_on_prem_connector_resource.go | 5 ++ .../data_safe_report_definition_resource.go | 5 ++ ..._sdm_masking_policy_difference_resource.go | 5 ++ .../data_safe_security_assessment_resource.go | 5 ++ ...data_safe_sensitive_data_model_resource.go | 5 ++ .../data_safe_sensitive_type_resource.go | 5 ++ ...arget_alert_policy_association_resource.go | 5 ++ .../data_safe_target_database_resource.go | 5 ++ .../data_safe_user_assessment_resource.go | 5 ++ .../database_application_vip_resource.go | 8 ++- ...database_dataguard_association_resource.go | 4 +- ..._autonomous_container_database_resource.go | 6 ++ ...ase_autonomous_database_backup_resource.go | 6 ++ .../database_autonomous_database_resource.go | 6 ++ ...onomous_exadata_infrastructure_resource.go | 6 ++ ...se_cloud_autonomous_vm_cluster_resource.go | 8 ++- .../database_cloud_vm_cluster_resource.go | 6 ++ .../database/database_database_resource.go | 8 ++- .../database/database_db_home_resource.go | 6 ++ .../database/database_db_system_resource.go | 6 ++ .../database_db_systems_upgrade_resource.go | 8 ++- ...se_external_container_database_resource.go | 6 ++ ...se_external_database_connector_resource.go | 6 ++ ...xternal_non_container_database_resource.go | 8 ++- ...se_external_pluggable_database_resource.go | 8 ++- ...db_management_private_endpoint_resource.go | 17 ++++++ ...tabase_management_external_asm_resource.go | 17 ++++++ ...ment_external_cluster_instance_resource.go | 17 ++++++ ...se_management_external_cluster_resource.go | 17 ++++++ ...se_management_external_db_node_resource.go | 17 ++++++ ..._management_external_db_system_resource.go | 5 ++ ...e_management_external_listener_resource.go | 17 ++++++ .../database_migration_connection_resource.go | 5 ++ .../database_migration_migration_resource.go | 5 ++ ...ools_database_tools_connection_resource.go | 5 ++ ...atabase_tools_private_endpoint_resource.go | 5 ++ ...talog_catalog_private_endpoint_resource.go | 17 ++++++ .../datacatalog_catalog_resource.go | 17 ++++++ .../datacatalog_metastore_resource.go | 17 ++++++ .../dataflow_private_endpoint_resource.go | 5 ++ .../dataintegration_workspace_resource.go | 17 ++++++ .../datascience_model_deployment_resource.go | 5 ++ .../devops/devops_build_pipeline_resource.go | 5 ++ .../devops_build_pipeline_stage_resource.go | 5 ++ .../devops/devops_connection_resource.go | 5 ++ .../devops/devops_deploy_artifact_resource.go | 5 ++ .../devops_deploy_environment_resource.go | 5 ++ .../devops/devops_deploy_pipeline_resource.go | 5 ++ .../devops/devops_deploy_stage_resource.go | 5 ++ .../service/devops/devops_project_resource.go | 5 ++ .../devops/devops_repository_resource.go | 5 ++ .../service/devops/devops_trigger_resource.go | 5 ++ ...ter_recovery_dr_plan_execution_resource.go | 5 ++ .../disaster_recovery_dr_plan_resource.go | 5 ++ ...r_recovery_dr_protection_group_resource.go | 5 ++ .../em_warehouse_em_warehouse_resource.go | 17 ++++++ internal/service/email/email_dkim_resource.go | 5 ++ .../email/email_email_domain_resource.go | 5 ++ ...apps_fusion_environment_family_resource.go | 17 ++++++ ...fusion_apps_fusion_environment_resource.go | 17 ++++++ ...den_gate_connection_assignment_resource.go | 5 ++ .../golden_gate_connection_resource.go | 5 ++ ...den_gate_database_registration_resource.go | 5 ++ .../golden_gate_deployment_backup_resource.go | 17 ++++++ .../golden_gate_deployment_resource.go | 5 ++ .../identity/identity_domain_resource.go | 17 ++++++ ...tegration_integration_instance_resource.go | 17 ++++++ internal/service/jms/jms_fleet_resource.go | 17 ++++++ .../load_balancer_load_balancer_resource.go | 5 ++ .../logging/logging_log_group_resource.go | 17 ++++++ ...ng_unified_agent_configuration_resource.go | 17 ++++++ ...rewall_network_firewall_policy_resource.go | 5 ++ ...work_firewall_network_firewall_resource.go | 5 ++ ...balancer_network_load_balancer_resource.go | 5 ++ .../service/nosql/nosql_table_resource.go | 17 ++++++ .../service/oce/oce_oce_instance_resource.go | 17 ++++++ .../service/ocvp/ocvp_esxi_host_resource.go | 17 ++++++ internal/service/ocvp/ocvp_sddc_resource.go | 17 ++++++ .../service/oda/oda_oda_instance_resource.go | 5 ++ ...da_private_endpoint_attachment_resource.go | 5 ++ .../oda/oda_oda_private_endpoint_resource.go | 5 ++ .../service/opa/opa_opa_instance_resource.go | 17 ++++++ .../opensearch_opensearch_cluster_resource.go | 17 ++++++ .../service/opsi/opsi_awr_hub_resource.go | 5 ++ .../opsi/opsi_database_insight_resource.go | 5 ++ ...opsi_enterprise_manager_bridge_resource.go | 5 ++ .../opsi/opsi_exadata_insight_resource.go | 5 ++ .../opsi/opsi_host_insight_resource.go | 5 ++ ...ions_insights_private_endpoint_resource.go | 5 ++ ..._operations_insights_warehouse_resource.go | 5 ++ ...ations_insights_warehouse_user_resource.go | 5 ++ .../opsi/opsi_opsi_configuration_resource.go | 5 ++ .../service/queue/queue_queue_resource.go | 17 ++++++ .../recovery_protected_database_resource.go | 5 ++ .../recovery_protection_policy_resource.go | 5 ++ ...covery_recovery_service_subnet_resource.go | 5 ++ .../sch/sch_service_connector_resource.go | 17 ++++++ .../service_mesh_access_policy_resource.go | 5 ++ .../service_mesh_ingress_gateway_resource.go | 5 ++ ...sh_ingress_gateway_route_table_resource.go | 5 ++ .../service_mesh_mesh_resource.go | 5 ++ ...ervice_mesh_virtual_deployment_resource.go | 5 ++ .../service_mesh_virtual_service_resource.go | 5 ++ ...sh_virtual_service_route_table_resource.go | 5 ++ ..._monitoring_monitored_resource_resource.go | 5 ++ .../vbs_inst_vbs_instance_resource.go | 17 ++++++ .../visual_builder_vb_instance_resource.go | 17 ++++++ .../vn_monitoring_path_analysi_resource.go | 17 ++++++ ...scanning_container_scan_recipe_resource.go | 5 ++ ...scanning_container_scan_target_resource.go | 5 ++ ...aa_web_app_acceleration_policy_resource.go | 5 ++ .../waa/waa_web_app_acceleration_resource.go | 5 ++ .../waas/waas_http_redirect_resource.go | 17 ++++++ .../service/waas/waas_waas_policy_resource.go | 17 ++++++ .../waf/waf_network_address_list_resource.go | 5 ++ .../waf_web_app_firewall_policy_resource.go | 5 ++ .../waf/waf_web_app_firewall_resource.go | 5 ++ internal/tfresource/crud_helpers.go | 26 ++++++++ internal/tfresource/crud_helpers_test.go | 61 ++++++++++++++++++- 162 files changed, 1463 insertions(+), 12 deletions(-) diff --git a/internal/service/adm/adm_knowledge_base_resource.go b/internal/service/adm/adm_knowledge_base_resource.go index ee9b9eeb07b..93461cabd7d 100644 --- a/internal/service/adm/adm_knowledge_base_resource.go +++ b/internal/service/adm/adm_knowledge_base_resource.go @@ -180,6 +180,23 @@ func (s *AdmKnowledgeBaseResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_adm.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_adm.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "adm"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "knowledgebase") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getKnowledgeBaseFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "adm"), oci_adm.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/ai_anomaly_detection/ai_anomaly_detection_ai_private_endpoint_resource.go b/internal/service/ai_anomaly_detection/ai_anomaly_detection_ai_private_endpoint_resource.go index 7bb8e9df1c0..74dc562a092 100644 --- a/internal/service/ai_anomaly_detection/ai_anomaly_detection_ai_private_endpoint_resource.go +++ b/internal/service/ai_anomaly_detection/ai_anomaly_detection_ai_private_endpoint_resource.go @@ -221,6 +221,23 @@ func (s *AiAnomalyDetectionAiPrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_ai_anomaly_detection.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_ai_anomaly_detection.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_anomaly_detection"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "aiprivateendpoint") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getAiPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_anomaly_detection"), oci_ai_anomaly_detection.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/ai_anomaly_detection/ai_anomaly_detection_model_resource.go b/internal/service/ai_anomaly_detection/ai_anomaly_detection_model_resource.go index c26baa38164..6dbb588e0f1 100644 --- a/internal/service/ai_anomaly_detection/ai_anomaly_detection_model_resource.go +++ b/internal/service/ai_anomaly_detection/ai_anomaly_detection_model_resource.go @@ -385,6 +385,11 @@ func (s *AiAnomalyDetectionModelResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_anomaly_detection"), oci_ai_anomaly_detection.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/ai_vision/ai_vision_model_resource.go b/internal/service/ai_vision/ai_vision_model_resource.go index 846f44596e8..e8673d2b187 100644 --- a/internal/service/ai_vision/ai_vision_model_resource.go +++ b/internal/service/ai_vision/ai_vision_model_resource.go @@ -468,6 +468,11 @@ func (s *AiVisionModelResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_vision"), oci_ai_vision.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/ai_vision/ai_vision_project_resource.go b/internal/service/ai_vision/ai_vision_project_resource.go index f62699f4232..8d022cfdc50 100644 --- a/internal/service/ai_vision/ai_vision_project_resource.go +++ b/internal/service/ai_vision/ai_vision_project_resource.go @@ -194,6 +194,11 @@ func (s *AiVisionProjectResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getProjectFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_vision"), oci_ai_vision.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/analytics/analytics_analytics_instance_resource.go b/internal/service/analytics/analytics_analytics_instance_resource.go index f44beb8cce5..398471292be 100644 --- a/internal/service/analytics/analytics_analytics_instance_resource.go +++ b/internal/service/analytics/analytics_analytics_instance_resource.go @@ -467,6 +467,11 @@ func (s *AnalyticsAnalyticsInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getAnalyticsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "analytics"), oci_analytics.WorkRequestActionResultCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/apigateway/apigateway_api_resource.go b/internal/service/apigateway/apigateway_api_resource.go index d9461f55772..0c2c4d08679 100644 --- a/internal/service/apigateway/apigateway_api_resource.go +++ b/internal/service/apigateway/apigateway_api_resource.go @@ -218,6 +218,11 @@ func (s *ApigatewayApiResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } err = s.getApiFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway"), oci_apigateway.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) if err != nil { return err diff --git a/internal/service/apigateway/apigateway_certificate_resource.go b/internal/service/apigateway/apigateway_certificate_resource.go index 7d34ef4f683..b57d3ad297f 100644 --- a/internal/service/apigateway/apigateway_certificate_resource.go +++ b/internal/service/apigateway/apigateway_certificate_resource.go @@ -226,6 +226,11 @@ func (s *ApigatewayCertificateResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getCertificateFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway"), oci_apigateway.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/apigateway/apigateway_deployment_resource.go b/internal/service/apigateway/apigateway_deployment_resource.go index 0a6b057d727..75d8b729993 100644 --- a/internal/service/apigateway/apigateway_deployment_resource.go +++ b/internal/service/apigateway/apigateway_deployment_resource.go @@ -3157,6 +3157,11 @@ func (s *ApigatewayDeploymentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway"), oci_apigateway.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/apigateway/apigateway_gateway_resource.go b/internal/service/apigateway/apigateway_gateway_resource.go index 1084087c25e..7e0b2cf0290 100644 --- a/internal/service/apigateway/apigateway_gateway_resource.go +++ b/internal/service/apigateway/apigateway_gateway_resource.go @@ -405,6 +405,11 @@ func (s *ApigatewayGatewayResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getGatewayFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway"), oci_apigateway.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/apigateway/apigateway_subscriber_resource.go b/internal/service/apigateway/apigateway_subscriber_resource.go index 78b79d859a8..536be5cdfc1 100644 --- a/internal/service/apigateway/apigateway_subscriber_resource.go +++ b/internal/service/apigateway/apigateway_subscriber_resource.go @@ -241,6 +241,11 @@ func (s *ApigatewaySubscriberResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getSubscriberFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway"), oci_apigateway.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/apigateway/apigateway_usage_plan_resource.go b/internal/service/apigateway/apigateway_usage_plan_resource.go index cf551d44f41..649e012ab8e 100644 --- a/internal/service/apigateway/apigateway_usage_plan_resource.go +++ b/internal/service/apigateway/apigateway_usage_plan_resource.go @@ -296,6 +296,11 @@ func (s *ApigatewayUsagePlanResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getUsagePlanFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway"), oci_apigateway.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/apm/apm_apm_domain_resource.go b/internal/service/apm/apm_apm_domain_resource.go index 2d2d4be22cd..11aec937f72 100644 --- a/internal/service/apm/apm_apm_domain_resource.go +++ b/internal/service/apm/apm_apm_domain_resource.go @@ -198,6 +198,23 @@ func (s *ApmApmDomainResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_apm.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_apm.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apm"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "apmdomain") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getApmDomainFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apm"), oci_apm.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/appmgmt_control/appmgmt_control_monitor_plugin_management_resource.go b/internal/service/appmgmt_control/appmgmt_control_monitor_plugin_management_resource.go index b05965401e8..61deef1f086 100644 --- a/internal/service/appmgmt_control/appmgmt_control_monitor_plugin_management_resource.go +++ b/internal/service/appmgmt_control/appmgmt_control_monitor_plugin_management_resource.go @@ -108,6 +108,23 @@ func (s *AppmgmtControlMonitorPluginManagementResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_appmgmt_control.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_appmgmt_control.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "appmgmt_control"), + }, + }) + // The work request response contains an array of objects that finished the operation + for _, res := range workRequestResponse.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), "monitoredinstance") { + if res.ActionType == oci_appmgmt_control.ActionTypeCreated { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getMonitorPluginManagementFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "appmgmt_control"), oci_appmgmt_control.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/bastion/bastion_bastion_resource.go b/internal/service/bastion/bastion_bastion_resource.go index 9deaec4b7bc..45a24dcfef3 100644 --- a/internal/service/bastion/bastion_bastion_resource.go +++ b/internal/service/bastion/bastion_bastion_resource.go @@ -290,6 +290,11 @@ func (s *BastionBastionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getBastionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bastion"), oci_bastion.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/bastion/bastion_session_resource.go b/internal/service/bastion/bastion_session_resource.go index b1ce9154650..35b1de508cc 100644 --- a/internal/service/bastion/bastion_session_resource.go +++ b/internal/service/bastion/bastion_session_resource.go @@ -298,6 +298,11 @@ func (s *BastionSessionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getSessionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bastion"), oci_bastion.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/bds/bds_bds_instance_resource.go b/internal/service/bds/bds_bds_instance_resource.go index bac80a5c8e4..36f6f51ab1b 100644 --- a/internal/service/bds/bds_bds_instance_resource.go +++ b/internal/service/bds/bds_bds_instance_resource.go @@ -1060,6 +1060,23 @@ func (s *BdsBdsInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_bds.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_bds.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "bds") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } createResultError := s.getBdsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), oci_bds.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) if createResultError != nil { return createResultError diff --git a/internal/service/blockchain/blockchain_blockchain_platform_resource.go b/internal/service/blockchain/blockchain_blockchain_platform_resource.go index dc8fa57947b..3c1d09997ac 100644 --- a/internal/service/blockchain/blockchain_blockchain_platform_resource.go +++ b/internal/service/blockchain/blockchain_blockchain_platform_resource.go @@ -467,6 +467,23 @@ func (s *BlockchainBlockchainPlatformResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_blockchain.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_blockchain.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "blockchain"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "instance") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } err = s.getBlockchainPlatformFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "blockchain"), oci_blockchain.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) if err != nil { return err diff --git a/internal/service/cloud_bridge/cloud_bridge_agent_dependency_resource.go b/internal/service/cloud_bridge/cloud_bridge_agent_dependency_resource.go index c58fa1a11ca..5d469405029 100644 --- a/internal/service/cloud_bridge/cloud_bridge_agent_dependency_resource.go +++ b/internal/service/cloud_bridge/cloud_bridge_agent_dependency_resource.go @@ -257,6 +257,23 @@ func (s *CloudBridgeAgentDependencyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_cloud_bridge.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkRequestClient.GetWorkRequest(context.Background(), + oci_cloud_bridge.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_bridge"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "agentdependency") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getAgentDependencyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_bridge"), oci_cloud_bridge.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_bridge/cloud_bridge_asset_source_resource.go b/internal/service/cloud_bridge/cloud_bridge_asset_source_resource.go index 376db0c2960..31f588f55ec 100644 --- a/internal/service/cloud_bridge/cloud_bridge_asset_source_resource.go +++ b/internal/service/cloud_bridge/cloud_bridge_asset_source_resource.go @@ -263,6 +263,11 @@ func (s *CloudBridgeAssetSourceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getAssetSourceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_bridge"), oci_cloud_bridge.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_bridge/cloud_bridge_inventory_resource.go b/internal/service/cloud_bridge/cloud_bridge_inventory_resource.go index eeded1ba5ff..1e769043e10 100644 --- a/internal/service/cloud_bridge/cloud_bridge_inventory_resource.go +++ b/internal/service/cloud_bridge/cloud_bridge_inventory_resource.go @@ -189,6 +189,23 @@ func (s *CloudBridgeInventoryResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_cloud_bridge.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkRequestClient.GetWorkRequest(context.Background(), + oci_cloud_bridge.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_bridge"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "inventory") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getInventoryFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_bridge"), oci_cloud_bridge.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_guard/cloud_guard_data_source_resource.go b/internal/service/cloud_guard/cloud_guard_data_source_resource.go index 308e52ef8ac..385b8861b23 100644 --- a/internal/service/cloud_guard/cloud_guard_data_source_resource.go +++ b/internal/service/cloud_guard/cloud_guard_data_source_resource.go @@ -368,6 +368,23 @@ func (s *CloudGuardDataSourceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_cloud_guard.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_cloud_guard.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_guard"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getDataSourceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_guard"), oci_cloud_guard.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_migrations/cloud_migrations_migration_asset_resource.go b/internal/service/cloud_migrations/cloud_migrations_migration_asset_resource.go index be3dd008f1f..e3897bed425 100644 --- a/internal/service/cloud_migrations/cloud_migrations_migration_asset_resource.go +++ b/internal/service/cloud_migrations/cloud_migrations_migration_asset_resource.go @@ -267,6 +267,11 @@ func (s *CloudMigrationsMigrationAssetResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getMigrationAssetFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_migrations"), oci_cloud_migrations.ActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_migrations/cloud_migrations_migration_plan_resource.go b/internal/service/cloud_migrations/cloud_migrations_migration_plan_resource.go index da50597a8ef..16edb91f16e 100644 --- a/internal/service/cloud_migrations/cloud_migrations_migration_plan_resource.go +++ b/internal/service/cloud_migrations/cloud_migrations_migration_plan_resource.go @@ -537,6 +537,11 @@ func (s *CloudMigrationsMigrationPlanResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getMigrationPlanFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_migrations"), oci_cloud_migrations.ActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_migrations/cloud_migrations_replication_schedule_resource.go b/internal/service/cloud_migrations/cloud_migrations_replication_schedule_resource.go index edc131a1bfd..f370e42a423 100644 --- a/internal/service/cloud_migrations/cloud_migrations_replication_schedule_resource.go +++ b/internal/service/cloud_migrations/cloud_migrations_replication_schedule_resource.go @@ -193,6 +193,11 @@ func (s *CloudMigrationsReplicationScheduleResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getReplicationScheduleFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_migrations"), oci_cloud_migrations.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/cloud_migrations/cloud_migrations_target_asset_resource.go b/internal/service/cloud_migrations/cloud_migrations_target_asset_resource.go index b2bc20e33fb..5c7fdcd6ae6 100644 --- a/internal/service/cloud_migrations/cloud_migrations_target_asset_resource.go +++ b/internal/service/cloud_migrations/cloud_migrations_target_asset_resource.go @@ -1410,6 +1410,11 @@ func (s *CloudMigrationsTargetAssetResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getTargetAssetFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "cloud_migrations"), oci_cloud_migrations.ActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/container_instances/container_instances_container_instance_resource.go b/internal/service/container_instances/container_instances_container_instance_resource.go index e5b9cafcef5..9230aa3197c 100644 --- a/internal/service/container_instances/container_instances_container_instance_resource.go +++ b/internal/service/container_instances/container_instances_container_instance_resource.go @@ -1004,6 +1004,11 @@ func (s *ContainerInstancesContainerInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getContainerInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerinstance"), oci_container_instances.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/containerengine/containerengine_virtual_node_pool_resource.go b/internal/service/containerengine/containerengine_virtual_node_pool_resource.go index 1f456083e31..ca6b77bbcc0 100644 --- a/internal/service/containerengine/containerengine_virtual_node_pool_resource.go +++ b/internal/service/containerengine/containerengine_virtual_node_pool_resource.go @@ -446,6 +446,23 @@ func (s *ContainerengineVirtualNodePoolResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_containerengine.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_containerengine.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerengine"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "virtualnodepool") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getVirtualNodePoolFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerengine"), oci_containerengine.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/core/core_compute_capacity_reservation_resource.go b/internal/service/core/core_compute_capacity_reservation_resource.go index 2b2b1c57f10..45366cc1b20 100644 --- a/internal/service/core/core_compute_capacity_reservation_resource.go +++ b/internal/service/core/core_compute_capacity_reservation_resource.go @@ -312,7 +312,12 @@ func (s *CoreComputeCapacityReservationResourceCrud) Create() error { if workId == nil { return fmt.Errorf("CreateComputeCapacityReservation response.OpcWorkRequestId was nil") } - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "capacityreservation", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "capacityreservation", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/core/core_dedicated_vm_host_resource.go b/internal/service/core/core_dedicated_vm_host_resource.go index a5f7f21e376..671b7bf7e3a 100644 --- a/internal/service/core/core_dedicated_vm_host_resource.go +++ b/internal/service/core/core_dedicated_vm_host_resource.go @@ -222,7 +222,13 @@ func (s *CoreDedicatedVmHostResourceCrud) Create() error { s.Res = &response.DedicatedVmHost if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "dedicatedvmhost", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "dedicatedvmhost", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/core/core_image_resource.go b/internal/service/core/core_image_resource.go index a3e7b512c4f..21875c6776c 100644 --- a/internal/service/core/core_image_resource.go +++ b/internal/service/core/core_image_resource.go @@ -360,7 +360,13 @@ func (s *CoreImageResourceCrud) Create() error { s.Res = &response.Image if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "image", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "image", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/core/core_instance_pool_instance_resource.go b/internal/service/core/core_instance_pool_instance_resource.go index d401c9f604b..a7f0c144b46 100644 --- a/internal/service/core/core_instance_pool_instance_resource.go +++ b/internal/service/core/core_instance_pool_instance_resource.go @@ -211,7 +211,9 @@ func (s *CoreInstancePoolInstanceResourceCrud) Create() error { s.Res = &response.InstancePoolInstance if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "instancepool", oci_work_requests.WorkRequestResourceActionTypeRelated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "instancepool", oci_work_requests.WorkRequestResourceActionTypeRelated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/core/core_instance_resource.go b/internal/service/core/core_instance_resource.go index 223374b94ac..4459ad73529 100644 --- a/internal/service/core/core_instance_resource.go +++ b/internal/service/core/core_instance_resource.go @@ -1083,6 +1083,13 @@ func (s *CoreInstanceResourceCrud) Create() error { s.Res = &response.Instance + if workRequestId != nil { + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + } workRequestErr := tfresource.ResourceRefreshForHybridPolling(s.WorkRequestClient, workRequestId, "instance", oci_work_requests.WorkRequestResourceActionTypeCreated, s.DisableNotFoundRetries, s.D, s) if workRequestErr != nil { return workRequestErr diff --git a/internal/service/data_labeling_service/data_labeling_service_dataset_resource.go b/internal/service/data_labeling_service/data_labeling_service_dataset_resource.go index 163588827de..e2de7d3e890 100644 --- a/internal/service/data_labeling_service/data_labeling_service_dataset_resource.go +++ b/internal/service/data_labeling_service/data_labeling_service_dataset_resource.go @@ -427,6 +427,11 @@ func (s *DataLabelingServiceDatasetResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDatasetFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_labeling_service"), oci_data_labeling_service.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_audit_archive_retrieval_resource.go b/internal/service/data_safe/data_safe_audit_archive_retrieval_resource.go index 53acd70b150..8d9dece22b3 100644 --- a/internal/service/data_safe/data_safe_audit_archive_retrieval_resource.go +++ b/internal/service/data_safe/data_safe_audit_archive_retrieval_resource.go @@ -245,6 +245,11 @@ func (s *DataSafeAuditArchiveRetrievalResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getAuditArchiveRetrievalFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_audit_policy_resource.go b/internal/service/data_safe/data_safe_audit_policy_resource.go index a51f1f44991..1f17711ae9f 100644 --- a/internal/service/data_safe/data_safe_audit_policy_resource.go +++ b/internal/service/data_safe/data_safe_audit_policy_resource.go @@ -408,6 +408,23 @@ func (s *DataSafeAuditPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_data_safe.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_data_safe.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "auditpolicy") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getAuditPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_audit_profile_resource.go b/internal/service/data_safe/data_safe_audit_profile_resource.go index a0a7463ec7b..53baade9447 100644 --- a/internal/service/data_safe/data_safe_audit_profile_resource.go +++ b/internal/service/data_safe/data_safe_audit_profile_resource.go @@ -373,6 +373,23 @@ func (s *DataSafeAuditProfileResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_data_safe.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_data_safe.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "auditprofile") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getAuditProfileFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_audit_trail_resource.go b/internal/service/data_safe/data_safe_audit_trail_resource.go index 8b136a53d9d..4c00f69d9fb 100644 --- a/internal/service/data_safe/data_safe_audit_trail_resource.go +++ b/internal/service/data_safe/data_safe_audit_trail_resource.go @@ -326,6 +326,23 @@ func (s *DataSafeAuditTrailResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_data_safe.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_data_safe.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "audittrail") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getAuditTrailFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_data_safe_configuration_resource.go b/internal/service/data_safe/data_safe_data_safe_configuration_resource.go index f57db85b355..71c4caafba0 100644 --- a/internal/service/data_safe/data_safe_data_safe_configuration_resource.go +++ b/internal/service/data_safe/data_safe_data_safe_configuration_resource.go @@ -182,6 +182,24 @@ func (s *DataSafeDataSafeConfigurationResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_data_safe.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_data_safe.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && (strings.Contains(strings.ToLower(*res.EntityType), "datasafeinstance") || strings.Contains(strings.ToLower(*res.EntityType), "configuration")) && + res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getDataSafeConfigurationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_data_safe_private_endpoint_resource.go b/internal/service/data_safe/data_safe_data_safe_private_endpoint_resource.go index c7e9b4af787..5dc5c7151dc 100644 --- a/internal/service/data_safe/data_safe_data_safe_private_endpoint_resource.go +++ b/internal/service/data_safe/data_safe_data_safe_private_endpoint_resource.go @@ -247,6 +247,11 @@ func (s *DataSafeDataSafePrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDataSafePrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_discovery_job_resource.go b/internal/service/data_safe/data_safe_discovery_job_resource.go index 3806a0157e9..463f3b29368 100644 --- a/internal/service/data_safe/data_safe_discovery_job_resource.go +++ b/internal/service/data_safe/data_safe_discovery_job_resource.go @@ -320,6 +320,11 @@ func (s *DataSafeDiscoveryJobResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDiscoveryJobFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_library_masking_format_resource.go b/internal/service/data_safe/data_safe_library_masking_format_resource.go index c6365fb16dd..5689bab231d 100644 --- a/internal/service/data_safe/data_safe_library_masking_format_resource.go +++ b/internal/service/data_safe/data_safe_library_masking_format_resource.go @@ -391,6 +391,11 @@ func (s *DataSafeLibraryMaskingFormatResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getLibraryMaskingFormatFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, "lmfcreate", s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_masking_policy_resource.go b/internal/service/data_safe/data_safe_masking_policy_resource.go index 33f949a7233..3fa1bc357ae 100644 --- a/internal/service/data_safe/data_safe_masking_policy_resource.go +++ b/internal/service/data_safe/data_safe_masking_policy_resource.go @@ -334,6 +334,11 @@ func (s *DataSafeMaskingPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getMaskingPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_on_prem_connector_resource.go b/internal/service/data_safe/data_safe_on_prem_connector_resource.go index 84995fe8d2f..5480da4c338 100644 --- a/internal/service/data_safe/data_safe_on_prem_connector_resource.go +++ b/internal/service/data_safe/data_safe_on_prem_connector_resource.go @@ -198,6 +198,11 @@ func (s *DataSafeOnPremConnectorResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOnPremConnectorFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_report_definition_resource.go b/internal/service/data_safe/data_safe_report_definition_resource.go index 3bada6cbad8..9434e1df03c 100644 --- a/internal/service/data_safe/data_safe_report_definition_resource.go +++ b/internal/service/data_safe/data_safe_report_definition_resource.go @@ -453,6 +453,11 @@ func (s *DataSafeReportDefinitionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getReportDefinitionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_sdm_masking_policy_difference_resource.go b/internal/service/data_safe/data_safe_sdm_masking_policy_difference_resource.go index ac83a2e5cad..95c114d2663 100644 --- a/internal/service/data_safe/data_safe_sdm_masking_policy_difference_resource.go +++ b/internal/service/data_safe/data_safe_sdm_masking_policy_difference_resource.go @@ -204,6 +204,11 @@ func (s *DataSafeSdmMaskingPolicyDifferenceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getSdmMaskingPolicyDifferenceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_security_assessment_resource.go b/internal/service/data_safe/data_safe_security_assessment_resource.go index 134160ec1ce..9bc7be79884 100644 --- a/internal/service/data_safe/data_safe_security_assessment_resource.go +++ b/internal/service/data_safe/data_safe_security_assessment_resource.go @@ -561,6 +561,11 @@ func (s *DataSafeSecurityAssessmentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getSecurityAssessmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_sensitive_data_model_resource.go b/internal/service/data_safe/data_safe_sensitive_data_model_resource.go index f9df239a5f8..7b013e717c9 100644 --- a/internal/service/data_safe/data_safe_sensitive_data_model_resource.go +++ b/internal/service/data_safe/data_safe_sensitive_data_model_resource.go @@ -293,6 +293,11 @@ func (s *DataSafeSensitiveDataModelResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getSensitiveDataModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_sensitive_type_resource.go b/internal/service/data_safe/data_safe_sensitive_type_resource.go index bfd601ea35e..fc11a1c934b 100644 --- a/internal/service/data_safe/data_safe_sensitive_type_resource.go +++ b/internal/service/data_safe/data_safe_sensitive_type_resource.go @@ -217,6 +217,11 @@ func (s *DataSafeSensitiveTypeResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getSensitiveTypeFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_target_alert_policy_association_resource.go b/internal/service/data_safe/data_safe_target_alert_policy_association_resource.go index 08e2bef5408..e0424a68386 100644 --- a/internal/service/data_safe/data_safe_target_alert_policy_association_resource.go +++ b/internal/service/data_safe/data_safe_target_alert_policy_association_resource.go @@ -218,6 +218,11 @@ func (s *DataSafeTargetAlertPolicyAssociationResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getTargetAlertPolicyAssociationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_target_database_resource.go b/internal/service/data_safe/data_safe_target_database_resource.go index 801b510a828..9d2de40f56a 100644 --- a/internal/service/data_safe/data_safe_target_database_resource.go +++ b/internal/service/data_safe/data_safe_target_database_resource.go @@ -414,6 +414,11 @@ func (s *DataSafeTargetDatabaseResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getTargetDatabaseFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/data_safe/data_safe_user_assessment_resource.go b/internal/service/data_safe/data_safe_user_assessment_resource.go index 431803e29a9..f740b437869 100644 --- a/internal/service/data_safe/data_safe_user_assessment_resource.go +++ b/internal/service/data_safe/data_safe_user_assessment_resource.go @@ -284,6 +284,11 @@ func (s *DataSafeUserAssessmentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getUserAssessmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "data_safe"), oci_data_safe.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database/database_application_vip_resource.go b/internal/service/database/database_application_vip_resource.go index d65b08fd4c3..8fa666db7dc 100644 --- a/internal/service/database/database_application_vip_resource.go +++ b/internal/service/database/database_application_vip_resource.go @@ -188,7 +188,13 @@ func (s *DatabaseApplicationVipResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "applicationVip", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "applicationvip", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go b/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go index 0230d5cdbf0..edb750dadc7 100644 --- a/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go +++ b/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go @@ -222,7 +222,9 @@ func (s *DatabaseAutonomousContainerDatabaseDataguardAssociationResourceCrud) Cr s.Res = &response.AutonomousContainerDatabaseDataguardAssociation if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "autonomousContainerDatabase", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "autonomouscontainerdatabase", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/database/database_autonomous_container_database_resource.go b/internal/service/database/database_autonomous_container_database_resource.go index 5c963fd5acd..f38f108ee5d 100644 --- a/internal/service/database/database_autonomous_container_database_resource.go +++ b/internal/service/database/database_autonomous_container_database_resource.go @@ -893,6 +893,12 @@ func (s *DatabaseAutonomousContainerDatabaseResourceCrud) Create() error { } workId := response.OpcWorkRequestId if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "database", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_autonomous_database_backup_resource.go b/internal/service/database/database_autonomous_database_backup_resource.go index be334ab9e50..d6e45dd00e3 100644 --- a/internal/service/database/database_autonomous_database_backup_resource.go +++ b/internal/service/database/database_autonomous_database_backup_resource.go @@ -285,6 +285,12 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "database", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_autonomous_database_resource.go b/internal/service/database/database_autonomous_database_resource.go index dc0902a6517..c4bb6d5af0d 100644 --- a/internal/service/database/database_autonomous_database_resource.go +++ b/internal/service/database/database_autonomous_database_resource.go @@ -1215,6 +1215,12 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "database", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_autonomous_exadata_infrastructure_resource.go b/internal/service/database/database_autonomous_exadata_infrastructure_resource.go index 0ab8d10c47d..a1c84fea74d 100644 --- a/internal/service/database/database_autonomous_exadata_infrastructure_resource.go +++ b/internal/service/database/database_autonomous_exadata_infrastructure_resource.go @@ -504,6 +504,12 @@ func (s *DatabaseAutonomousExadataInfrastructureResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "autonomousExadataInfrastructure", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go b/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go index 23c1519e518..86fbdc5288f 100644 --- a/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go +++ b/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go @@ -675,7 +675,13 @@ func (s *DatabaseCloudAutonomousVmClusterResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "cloudAutonomousVmCluster", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "cloudautonomousvmcluster", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/database/database_cloud_vm_cluster_resource.go b/internal/service/database/database_cloud_vm_cluster_resource.go index 7b437bc18b9..98ed551c12b 100644 --- a/internal/service/database/database_cloud_vm_cluster_resource.go +++ b/internal/service/database/database_cloud_vm_cluster_resource.go @@ -658,6 +658,12 @@ func (s *DatabaseCloudVmClusterResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "cloudVmCluster", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_database_resource.go b/internal/service/database/database_database_resource.go index 11c72060a3b..4695ca312bb 100644 --- a/internal/service/database/database_database_resource.go +++ b/internal/service/database/database_database_resource.go @@ -602,7 +602,13 @@ func (s *DatabaseDatabaseResourceCrud) Create() error { s.Res = &response.Database if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "database", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "database", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/database/database_db_home_resource.go b/internal/service/database/database_db_home_resource.go index 8e3b20d3fc8..4f51a5473c0 100644 --- a/internal/service/database/database_db_home_resource.go +++ b/internal/service/database/database_db_home_resource.go @@ -532,6 +532,12 @@ func (s *DatabaseDbHomeResourceCrud) Create() error { } else { if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "dbHome", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_db_system_resource.go b/internal/service/database/database_db_system_resource.go index be17fc83d19..c218fb3b111 100644 --- a/internal/service/database/database_db_system_resource.go +++ b/internal/service/database/database_db_system_resource.go @@ -1059,6 +1059,12 @@ func (s *DatabaseDbSystemResourceCrud) Create() error { workId := response.OpcWorkRequestId if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "database", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_db_systems_upgrade_resource.go b/internal/service/database/database_db_systems_upgrade_resource.go index fa57962f267..dfe968c6b94 100644 --- a/internal/service/database/database_db_systems_upgrade_resource.go +++ b/internal/service/database/database_db_systems_upgrade_resource.go @@ -472,7 +472,13 @@ func (s *DatabaseDbSystemsUpgradeResourceCrud) Create() error { s.Res = &response.DbSystem if workId != nil { - identifier, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "dbSystem", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "dbSystem", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries) if identifier != nil { s.D.SetId(*identifier) } diff --git a/internal/service/database/database_external_container_database_resource.go b/internal/service/database/database_external_container_database_resource.go index 00fb3fa124f..1acf9a0b8aa 100644 --- a/internal/service/database/database_external_container_database_resource.go +++ b/internal/service/database/database_external_container_database_resource.go @@ -259,6 +259,12 @@ func (s *DatabaseExternalContainerDatabaseResourceCrud) Create() error { s.Res = &response.ExternalContainerDatabase if workId != nil { + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "externalContainerDatabase", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_external_database_connector_resource.go b/internal/service/database/database_external_database_connector_resource.go index 4338de42563..7e8b3a4f93d 100644 --- a/internal/service/database/database_external_database_connector_resource.go +++ b/internal/service/database/database_external_database_connector_resource.go @@ -273,6 +273,12 @@ func (s *DatabaseExternalDatabaseConnectorResourceCrud) Create() error { s.Res = &response.ExternalDatabaseConnector if workId != nil { + var identifier *string + var err error + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "externalDatabaseConnector", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err diff --git a/internal/service/database/database_external_non_container_database_resource.go b/internal/service/database/database_external_non_container_database_resource.go index 5c5ed2248f4..abdbb81b7bd 100644 --- a/internal/service/database/database_external_non_container_database_resource.go +++ b/internal/service/database/database_external_non_container_database_resource.go @@ -281,7 +281,13 @@ func (s *DatabaseExternalNonContainerDatabaseResourceCrud) Create() error { s.Res = &response.ExternalNonContainerDatabase if workId != nil { - _, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "externalNonContainerDatabase", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "externalNonContainerDatabase", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err } diff --git a/internal/service/database/database_external_pluggable_database_resource.go b/internal/service/database/database_external_pluggable_database_resource.go index 1c715ac3e87..3380da7699d 100644 --- a/internal/service/database/database_external_pluggable_database_resource.go +++ b/internal/service/database/database_external_pluggable_database_resource.go @@ -301,7 +301,13 @@ func (s *DatabaseExternalPluggableDatabaseResourceCrud) Create() error { s.Res = &response.ExternalPluggableDatabase if workId != nil { - _, err := tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "externalPluggableDatabase", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) + var identifier *string + var err error + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + _, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "externalPluggableDatabase", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries) if err != nil { return err } diff --git a/internal/service/database_management/database_management_db_management_private_endpoint_resource.go b/internal/service/database_management/database_management_db_management_private_endpoint_resource.go index 36ec57be664..2e5b59667b1 100644 --- a/internal/service/database_management/database_management_db_management_private_endpoint_resource.go +++ b/internal/service/database_management/database_management_db_management_private_endpoint_resource.go @@ -207,6 +207,23 @@ func (s *DatabaseManagementDbManagementPrivateEndpointResourceCrud) Create() err } workId := response.OpcWorkRequestId + workRequestResponse := oci_database_management.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_database_management.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "dbmgmtprivateendpoint") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getDbManagementPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_management/database_management_external_asm_resource.go b/internal/service/database_management/database_management_external_asm_resource.go index 6ecef3af19b..e7c4c3ee0e2 100644 --- a/internal/service/database_management/database_management_external_asm_resource.go +++ b/internal/service/database_management/database_management_external_asm_resource.go @@ -235,6 +235,23 @@ func (s *DatabaseManagementExternalAsmResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_database_management.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_database_management.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "asm") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getExternalAsmFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_management/database_management_external_cluster_instance_resource.go b/internal/service/database_management/database_management_external_cluster_instance_resource.go index 2a9063b087c..e19ddc2ea42 100644 --- a/internal/service/database_management/database_management_external_cluster_instance_resource.go +++ b/internal/service/database_management/database_management_external_cluster_instance_resource.go @@ -190,6 +190,23 @@ func (s *DatabaseManagementExternalClusterInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_database_management.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_database_management.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "cluster") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getExternalClusterInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_management/database_management_external_cluster_resource.go b/internal/service/database_management/database_management_external_cluster_resource.go index df8edf8185e..abc8b956039 100644 --- a/internal/service/database_management/database_management_external_cluster_resource.go +++ b/internal/service/database_management/database_management_external_cluster_resource.go @@ -266,6 +266,23 @@ func (s *DatabaseManagementExternalClusterResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_database_management.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_database_management.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "cluster") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getExternalClusterFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_management/database_management_external_db_node_resource.go b/internal/service/database_management/database_management_external_db_node_resource.go index fbe028dcb41..23b3f0cb7b3 100644 --- a/internal/service/database_management/database_management_external_db_node_resource.go +++ b/internal/service/database_management/database_management_external_db_node_resource.go @@ -183,6 +183,23 @@ func (s *DatabaseManagementExternalDbNodeResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_database_management.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_database_management.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "node") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getExternalDbNodeFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_management/database_management_external_db_system_resource.go b/internal/service/database_management/database_management_external_db_system_resource.go index 5a151f1d33c..2b4640cfbaa 100644 --- a/internal/service/database_management/database_management_external_db_system_resource.go +++ b/internal/service/database_management/database_management_external_db_system_resource.go @@ -208,6 +208,11 @@ func (s *DatabaseManagementExternalDbSystemResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getExternalDbSystemFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_management/database_management_external_listener_resource.go b/internal/service/database_management/database_management_external_listener_resource.go index b91dc308a4b..b4bbe64fd36 100644 --- a/internal/service/database_management/database_management_external_listener_resource.go +++ b/internal/service/database_management/database_management_external_listener_resource.go @@ -318,6 +318,23 @@ func (s *DatabaseManagementExternalListenerResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_database_management.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_database_management.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "listener") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getExternalListenerFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_management"), oci_database_management.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_migration/database_migration_connection_resource.go b/internal/service/database_migration/database_migration_connection_resource.go index 7dece6aa0d1..7b3bd4b09d3 100644 --- a/internal/service/database_migration/database_migration_connection_resource.go +++ b/internal/service/database_migration/database_migration_connection_resource.go @@ -471,6 +471,11 @@ func (s *DatabaseMigrationConnectionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getConnectionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_migration"), oci_database_migration.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_migration/database_migration_migration_resource.go b/internal/service/database_migration/database_migration_migration_resource.go index f84cb21673d..048f872dd41 100644 --- a/internal/service/database_migration/database_migration_migration_resource.go +++ b/internal/service/database_migration/database_migration_migration_resource.go @@ -1007,6 +1007,11 @@ func (s *DatabaseMigrationMigrationResourceCrud) Create() error { return err } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getMigrationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_migration"), oci_database_migration.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_tools/database_tools_database_tools_connection_resource.go b/internal/service/database_tools/database_tools_database_tools_connection_resource.go index e2534a1acf3..5a2a626f2d4 100644 --- a/internal/service/database_tools/database_tools_database_tools_connection_resource.go +++ b/internal/service/database_tools/database_tools_database_tools_connection_resource.go @@ -327,6 +327,11 @@ func (s *DatabaseToolsDatabaseToolsConnectionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDatabaseToolsConnectionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_tools"), oci_database_tools.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/database_tools/database_tools_database_tools_private_endpoint_resource.go b/internal/service/database_tools/database_tools_database_tools_private_endpoint_resource.go index 02b0633ddd2..c221374c440 100644 --- a/internal/service/database_tools/database_tools_database_tools_private_endpoint_resource.go +++ b/internal/service/database_tools/database_tools_database_tools_private_endpoint_resource.go @@ -295,6 +295,11 @@ func (s *DatabaseToolsDatabaseToolsPrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDatabaseToolsPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database_tools"), oci_database_tools.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/datacatalog/datacatalog_catalog_private_endpoint_resource.go b/internal/service/datacatalog/datacatalog_catalog_private_endpoint_resource.go index 7c5340401fc..649a85cae6e 100644 --- a/internal/service/datacatalog/datacatalog_catalog_private_endpoint_resource.go +++ b/internal/service/datacatalog/datacatalog_catalog_private_endpoint_resource.go @@ -215,6 +215,23 @@ func (s *DatacatalogCatalogPrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_datacatalog.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_datacatalog.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datacatalog"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "catalogprivateendpoint") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getCatalogPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datacatalog"), oci_datacatalog.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/datacatalog/datacatalog_catalog_resource.go b/internal/service/datacatalog/datacatalog_catalog_resource.go index b0ddfe5c403..44fb3679235 100644 --- a/internal/service/datacatalog/datacatalog_catalog_resource.go +++ b/internal/service/datacatalog/datacatalog_catalog_resource.go @@ -199,6 +199,23 @@ func (s *DatacatalogCatalogResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_datacatalog.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_datacatalog.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datacatalog"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "catalog") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } err = s.getCatalogFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datacatalog"), oci_datacatalog.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) if err != nil { return err diff --git a/internal/service/datacatalog/datacatalog_metastore_resource.go b/internal/service/datacatalog/datacatalog_metastore_resource.go index f86f6178168..0c62e43e8fe 100644 --- a/internal/service/datacatalog/datacatalog_metastore_resource.go +++ b/internal/service/datacatalog/datacatalog_metastore_resource.go @@ -198,6 +198,23 @@ func (s *DatacatalogMetastoreResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_datacatalog.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_datacatalog.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datacatalog"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "metastore") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } err = s.getMetastoreFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datacatalog"), oci_datacatalog.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) if err != nil { return err diff --git a/internal/service/dataflow/dataflow_private_endpoint_resource.go b/internal/service/dataflow/dataflow_private_endpoint_resource.go index 3d6e380c43e..be7585c79ce 100644 --- a/internal/service/dataflow/dataflow_private_endpoint_resource.go +++ b/internal/service/dataflow/dataflow_private_endpoint_resource.go @@ -301,6 +301,11 @@ func (s *DataflowPrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "dataflow"), oci_dataflow.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/dataintegration/dataintegration_workspace_resource.go b/internal/service/dataintegration/dataintegration_workspace_resource.go index df74e2912ce..90dc5abe80d 100644 --- a/internal/service/dataintegration/dataintegration_workspace_resource.go +++ b/internal/service/dataintegration/dataintegration_workspace_resource.go @@ -325,6 +325,23 @@ func (s *DataintegrationWorkspaceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_dataintegration.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_dataintegration.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "dataintegration"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "disworkspace") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getWorkspaceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "disworkspace"), oci_dataintegration.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/datascience/datascience_model_deployment_resource.go b/internal/service/datascience/datascience_model_deployment_resource.go index c9956dde1ad..297430f9580 100644 --- a/internal/service/datascience/datascience_model_deployment_resource.go +++ b/internal/service/datascience/datascience_model_deployment_resource.go @@ -551,6 +551,11 @@ func (s *DatascienceModelDeploymentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getModelDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience"), oci_datascience.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_build_pipeline_resource.go b/internal/service/devops/devops_build_pipeline_resource.go index ccd78addfc9..d466efc7bdb 100644 --- a/internal/service/devops/devops_build_pipeline_resource.go +++ b/internal/service/devops/devops_build_pipeline_resource.go @@ -251,6 +251,11 @@ func (s *DevopsBuildPipelineResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getBuildPipelineFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_build_pipeline_stage_resource.go b/internal/service/devops/devops_build_pipeline_stage_resource.go index b096f4a3060..959a4acd652 100644 --- a/internal/service/devops/devops_build_pipeline_stage_resource.go +++ b/internal/service/devops/devops_build_pipeline_stage_resource.go @@ -465,6 +465,11 @@ func (s *DevopsBuildPipelineStageResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getBuildPipelineStageFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_connection_resource.go b/internal/service/devops/devops_connection_resource.go index fe8b7ce432f..1907d84de07 100644 --- a/internal/service/devops/devops_connection_resource.go +++ b/internal/service/devops/devops_connection_resource.go @@ -255,6 +255,11 @@ func (s *DevopsConnectionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getConnectionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_deploy_artifact_resource.go b/internal/service/devops/devops_deploy_artifact_resource.go index 0118f8a8bf5..457b067061b 100644 --- a/internal/service/devops/devops_deploy_artifact_resource.go +++ b/internal/service/devops/devops_deploy_artifact_resource.go @@ -325,6 +325,11 @@ func (s *DevopsDeployArtifactResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDeployArtifactFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_deploy_environment_resource.go b/internal/service/devops/devops_deploy_environment_resource.go index a98a61fb317..32c70dbeff8 100644 --- a/internal/service/devops/devops_deploy_environment_resource.go +++ b/internal/service/devops/devops_deploy_environment_resource.go @@ -293,6 +293,11 @@ func (s *DevopsDeployEnvironmentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDeployEnvironmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_deploy_pipeline_resource.go b/internal/service/devops/devops_deploy_pipeline_resource.go index a2b91c71b92..62566f66086 100644 --- a/internal/service/devops/devops_deploy_pipeline_resource.go +++ b/internal/service/devops/devops_deploy_pipeline_resource.go @@ -388,6 +388,11 @@ func (s *DevopsDeployPipelineResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDeployPipelineFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_deploy_stage_resource.go b/internal/service/devops/devops_deploy_stage_resource.go index 525ce1a69d2..b6d48ce7519 100644 --- a/internal/service/devops/devops_deploy_stage_resource.go +++ b/internal/service/devops/devops_deploy_stage_resource.go @@ -1021,6 +1021,11 @@ func (s *DevopsDeployStageResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDeployStageFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_project_resource.go b/internal/service/devops/devops_project_resource.go index eacf0758613..026525a64f0 100644 --- a/internal/service/devops/devops_project_resource.go +++ b/internal/service/devops/devops_project_resource.go @@ -226,6 +226,11 @@ func (s *DevopsProjectResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getProjectFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_repository_resource.go b/internal/service/devops/devops_repository_resource.go index df9d292e864..9e3178b159d 100644 --- a/internal/service/devops/devops_repository_resource.go +++ b/internal/service/devops/devops_repository_resource.go @@ -311,6 +311,11 @@ func (s *DevopsRepositoryResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getRepositoryFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/devops/devops_trigger_resource.go b/internal/service/devops/devops_trigger_resource.go index 8f7cba54aed..21e7ef69475 100644 --- a/internal/service/devops/devops_trigger_resource.go +++ b/internal/service/devops/devops_trigger_resource.go @@ -358,6 +358,11 @@ func (s *DevopsTriggerResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getTriggerFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "devops"), oci_devops.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/disaster_recovery/disaster_recovery_dr_plan_execution_resource.go b/internal/service/disaster_recovery/disaster_recovery_dr_plan_execution_resource.go index 61543ae0fcd..12e6aeaf070 100644 --- a/internal/service/disaster_recovery/disaster_recovery_dr_plan_execution_resource.go +++ b/internal/service/disaster_recovery/disaster_recovery_dr_plan_execution_resource.go @@ -413,6 +413,11 @@ func (s *DisasterRecoveryDrPlanExecutionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDrPlanExecutionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "disaster_recovery"), oci_disaster_recovery.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/disaster_recovery/disaster_recovery_dr_plan_resource.go b/internal/service/disaster_recovery/disaster_recovery_dr_plan_resource.go index 8d8f85a8c3f..9d0d0e69373 100644 --- a/internal/service/disaster_recovery/disaster_recovery_dr_plan_resource.go +++ b/internal/service/disaster_recovery/disaster_recovery_dr_plan_resource.go @@ -346,6 +346,11 @@ func (s *DisasterRecoveryDrPlanResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDrPlanFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "disaster_recovery"), oci_disaster_recovery.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/disaster_recovery/disaster_recovery_dr_protection_group_resource.go b/internal/service/disaster_recovery/disaster_recovery_dr_protection_group_resource.go index 9285eaa0ed4..1dd2c86cf62 100644 --- a/internal/service/disaster_recovery/disaster_recovery_dr_protection_group_resource.go +++ b/internal/service/disaster_recovery/disaster_recovery_dr_protection_group_resource.go @@ -414,6 +414,11 @@ func (s *DisasterRecoveryDrProtectionGroupResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDrProtectionGroupFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "disaster_recovery"), oci_disaster_recovery.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/em_warehouse/em_warehouse_em_warehouse_resource.go b/internal/service/em_warehouse/em_warehouse_em_warehouse_resource.go index 1b428c3ba92..763d6e0edfa 100644 --- a/internal/service/em_warehouse/em_warehouse_em_warehouse_resource.go +++ b/internal/service/em_warehouse/em_warehouse_em_warehouse_resource.go @@ -220,6 +220,23 @@ func (s *EmWarehouseEmWarehouseResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_em_warehouse.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_em_warehouse.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "emwarehouse"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "emwarehouse") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getEmWarehouseFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "emwarehouse"), oci_em_warehouse.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/email/email_dkim_resource.go b/internal/service/email/email_dkim_resource.go index 24309db4cc5..c4e6d4da3cb 100644 --- a/internal/service/email/email_dkim_resource.go +++ b/internal/service/email/email_dkim_resource.go @@ -213,6 +213,11 @@ func (s *EmailDkimResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDkimFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "email"), oci_email.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/email/email_email_domain_resource.go b/internal/service/email/email_email_domain_resource.go index ec9b6ec3d07..b91e6366490 100644 --- a/internal/service/email/email_email_domain_resource.go +++ b/internal/service/email/email_email_domain_resource.go @@ -194,6 +194,11 @@ func (s *EmailEmailDomainResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getEmailDomainFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "email"), oci_email.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/fusion_apps/fusion_apps_fusion_environment_family_resource.go b/internal/service/fusion_apps/fusion_apps_fusion_environment_family_resource.go index 6dd7a608b31..ef150553052 100644 --- a/internal/service/fusion_apps/fusion_apps_fusion_environment_family_resource.go +++ b/internal/service/fusion_apps/fusion_apps_fusion_environment_family_resource.go @@ -248,6 +248,23 @@ func (s *FusionAppsFusionEnvironmentFamilyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_fusion_apps.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_fusion_apps.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "fusion_apps"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "fusionenvironmentfamily") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getFusionEnvironmentFamilyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "fusion_apps"), oci_fusion_apps.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/fusion_apps/fusion_apps_fusion_environment_resource.go b/internal/service/fusion_apps/fusion_apps_fusion_environment_resource.go index 458843c690f..a21cf2bcb70 100644 --- a/internal/service/fusion_apps/fusion_apps_fusion_environment_resource.go +++ b/internal/service/fusion_apps/fusion_apps_fusion_environment_resource.go @@ -538,6 +538,23 @@ func (s *FusionAppsFusionEnvironmentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_fusion_apps.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_fusion_apps.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "fusion_apps"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "fusionenvironment") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getFusionEnvironmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "fusion_apps"), oci_fusion_apps.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/golden_gate/golden_gate_connection_assignment_resource.go b/internal/service/golden_gate/golden_gate_connection_assignment_resource.go index cd1dbc88867..452592358a9 100644 --- a/internal/service/golden_gate/golden_gate_connection_assignment_resource.go +++ b/internal/service/golden_gate/golden_gate_connection_assignment_resource.go @@ -135,6 +135,11 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } // Wait until it finishes _, err = connectionAssignmentWaitForWorkRequest(workId, "goldengateconnectionassignment", diff --git a/internal/service/golden_gate/golden_gate_connection_resource.go b/internal/service/golden_gate/golden_gate_connection_resource.go index d9e15dd4d83..42478fb478b 100644 --- a/internal/service/golden_gate/golden_gate_connection_resource.go +++ b/internal/service/golden_gate/golden_gate_connection_resource.go @@ -567,6 +567,11 @@ func (s *GoldenGateConnectionResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getConnectionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/golden_gate/golden_gate_database_registration_resource.go b/internal/service/golden_gate/golden_gate_database_registration_resource.go index 20c6645a490..9cd978928a0 100644 --- a/internal/service/golden_gate/golden_gate_database_registration_resource.go +++ b/internal/service/golden_gate/golden_gate_database_registration_resource.go @@ -336,6 +336,11 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDatabaseRegistrationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/golden_gate/golden_gate_deployment_backup_resource.go b/internal/service/golden_gate/golden_gate_deployment_backup_resource.go index 46e3ed5bf37..06221a16eb7 100644 --- a/internal/service/golden_gate/golden_gate_deployment_backup_resource.go +++ b/internal/service/golden_gate/golden_gate_deployment_backup_resource.go @@ -251,6 +251,23 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_golden_gate.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_golden_gate.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "deploymentbackup") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getDeploymentBackupFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/golden_gate/golden_gate_deployment_resource.go b/internal/service/golden_gate/golden_gate_deployment_resource.go index 1c0a8bd4bcd..5122563f100 100644 --- a/internal/service/golden_gate/golden_gate_deployment_resource.go +++ b/internal/service/golden_gate/golden_gate_deployment_resource.go @@ -574,6 +574,11 @@ func (s *GoldenGateDeploymentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/identity/identity_domain_resource.go b/internal/service/identity/identity_domain_resource.go index 1e9edb5b44e..e172f5ef904 100644 --- a/internal/service/identity/identity_domain_resource.go +++ b/internal/service/identity/identity_domain_resource.go @@ -364,6 +364,23 @@ func (s *IdentityDomainResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_identity.GetIamWorkRequestResponse{} + workRequestResponse, err = s.Client.GetIamWorkRequest(context.Background(), + oci_identity.GetIamWorkRequestRequest{ + IamWorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "identity"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "domain") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getDomainFromWorkRequest(workId, oci_identity.IamWorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/integration/integration_integration_instance_resource.go b/internal/service/integration/integration_integration_instance_resource.go index 8035bf39e94..98d163a2fd0 100644 --- a/internal/service/integration/integration_integration_instance_resource.go +++ b/internal/service/integration/integration_integration_instance_resource.go @@ -606,6 +606,23 @@ func (s *IntegrationIntegrationInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_integration.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_integration.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "integration"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "integration") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getIntegrationInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "integration"), oci_integration.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/jms/jms_fleet_resource.go b/internal/service/jms/jms_fleet_resource.go index dff9833940d..e873fb5366e 100644 --- a/internal/service/jms/jms_fleet_resource.go +++ b/internal/service/jms/jms_fleet_resource.go @@ -285,6 +285,23 @@ func (s *JmsFleetResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_jms.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_jms.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "jms"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "fleet") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getFleetFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "jms"), oci_jms.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/load_balancer/load_balancer_load_balancer_resource.go b/internal/service/load_balancer/load_balancer_load_balancer_resource.go index f2e081dface..ea74771fe85 100644 --- a/internal/service/load_balancer/load_balancer_load_balancer_resource.go +++ b/internal/service/load_balancer/load_balancer_load_balancer_resource.go @@ -384,6 +384,11 @@ func (s *LoadBalancerLoadBalancerResourceCrud) Create() error { if err != nil { return err } + var identifier *string + identifier = workRequestResponse.LoadBalancerId + if identifier != nil { + s.D.SetId(*identifier) + } s.WorkRequest = &workRequestResponse.WorkRequest err = loadBalancerWaitForWorkRequest(s.Client, s.D, s.WorkRequest, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "load_balancer")) if err != nil { diff --git a/internal/service/logging/logging_log_group_resource.go b/internal/service/logging/logging_log_group_resource.go index b7416ab5558..0f8f862c704 100644 --- a/internal/service/logging/logging_log_group_resource.go +++ b/internal/service/logging/logging_log_group_resource.go @@ -182,6 +182,23 @@ func (s *LoggingLogGroupResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_logging.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_logging.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "logging"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "loggroup") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getLogGroupFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "logging"), oci_logging.ActionTypesCreated, 5*time.Minute) } diff --git a/internal/service/logging/logging_unified_agent_configuration_resource.go b/internal/service/logging/logging_unified_agent_configuration_resource.go index eee3c3002a1..19d3bd64994 100644 --- a/internal/service/logging/logging_unified_agent_configuration_resource.go +++ b/internal/service/logging/logging_unified_agent_configuration_resource.go @@ -522,6 +522,23 @@ func (s *LoggingUnifiedAgentConfigurationResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_logging.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_logging.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "logging"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "unifiedagentconfiguration") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getUnifiedAgentConfigurationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "logging"), oci_logging.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/network_firewall/network_firewall_network_firewall_policy_resource.go b/internal/service/network_firewall/network_firewall_network_firewall_policy_resource.go index 05972612d7a..b92991442d9 100644 --- a/internal/service/network_firewall/network_firewall_network_firewall_policy_resource.go +++ b/internal/service/network_firewall/network_firewall_network_firewall_policy_resource.go @@ -600,6 +600,11 @@ func (s *NetworkFirewallNetworkFirewallPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getNetworkFirewallPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "network_firewall"), oci_network_firewall.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/network_firewall/network_firewall_network_firewall_resource.go b/internal/service/network_firewall/network_firewall_network_firewall_resource.go index a4a094d954c..362a5ed697a 100644 --- a/internal/service/network_firewall/network_firewall_network_firewall_resource.go +++ b/internal/service/network_firewall/network_firewall_network_firewall_resource.go @@ -264,6 +264,11 @@ func (s *NetworkFirewallNetworkFirewallResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getNetworkFirewallFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "network_firewall"), oci_network_firewall.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/network_load_balancer/network_load_balancer_network_load_balancer_resource.go b/internal/service/network_load_balancer/network_load_balancer_network_load_balancer_resource.go index 904e427f87b..bdbc0c7d1ce 100644 --- a/internal/service/network_load_balancer/network_load_balancer_network_load_balancer_resource.go +++ b/internal/service/network_load_balancer/network_load_balancer_network_load_balancer_resource.go @@ -323,6 +323,11 @@ func (s *NetworkLoadBalancerNetworkLoadBalancerResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getNetworkLoadBalancerFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "network_load_balancer"), oci_network_load_balancer.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/nosql/nosql_table_resource.go b/internal/service/nosql/nosql_table_resource.go index bbd41eb1398..d7b09153dc2 100644 --- a/internal/service/nosql/nosql_table_resource.go +++ b/internal/service/nosql/nosql_table_resource.go @@ -352,6 +352,23 @@ func (s *NosqlTableResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_nosql.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_nosql.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "nosql"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "table") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getTableFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "nosql"), oci_nosql.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/oce/oce_oce_instance_resource.go b/internal/service/oce/oce_oce_instance_resource.go index 3170244a51d..1bf77966f5e 100644 --- a/internal/service/oce/oce_oce_instance_resource.go +++ b/internal/service/oce/oce_oce_instance_resource.go @@ -345,6 +345,23 @@ func (s *OceOceInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_oce.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_oce.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "oce"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "oce") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getOceInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "oce"), oci_oce.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/ocvp/ocvp_esxi_host_resource.go b/internal/service/ocvp/ocvp_esxi_host_resource.go index 74f737b0205..e21e81a6247 100644 --- a/internal/service/ocvp/ocvp_esxi_host_resource.go +++ b/internal/service/ocvp/ocvp_esxi_host_resource.go @@ -294,6 +294,23 @@ func (s *OcvpEsxiHostResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_ocvp.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkRequestClient.GetWorkRequest(context.Background(), + oci_ocvp.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "esxihost") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getEsxiHostFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), oci_ocvp.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/ocvp/ocvp_sddc_resource.go b/internal/service/ocvp/ocvp_sddc_resource.go index 5e89902bb07..97215706c59 100644 --- a/internal/service/ocvp/ocvp_sddc_resource.go +++ b/internal/service/ocvp/ocvp_sddc_resource.go @@ -661,6 +661,23 @@ func (s *OcvpSddcResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_ocvp.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkRequestClient.GetWorkRequest(context.Background(), + oci_ocvp.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "sddc") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } creationError := s.getSddcFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), oci_ocvp.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) if creationError != nil { diff --git a/internal/service/oda/oda_oda_instance_resource.go b/internal/service/oda/oda_oda_instance_resource.go index cdd78d3b0d5..2ae74d5064f 100644 --- a/internal/service/oda/oda_oda_instance_resource.go +++ b/internal/service/oda/oda_oda_instance_resource.go @@ -373,6 +373,11 @@ func (s *OdaOdaInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOdaInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "oda"), oci_oda.WorkRequestResourceResourceActionCreate, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/oda/oda_oda_private_endpoint_attachment_resource.go b/internal/service/oda/oda_oda_private_endpoint_attachment_resource.go index 3bdce254b1d..b009a7a5480 100644 --- a/internal/service/oda/oda_oda_private_endpoint_attachment_resource.go +++ b/internal/service/oda/oda_oda_private_endpoint_attachment_resource.go @@ -149,6 +149,11 @@ func (s *OdaOdaPrivateEndpointAttachmentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOdaPrivateEndpointAttachmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "oda"), oci_oda.WorkRequestResourceResourceActionCreate, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/oda/oda_oda_private_endpoint_resource.go b/internal/service/oda/oda_oda_private_endpoint_resource.go index 0514ec51892..2ddf58f1c6d 100644 --- a/internal/service/oda/oda_oda_private_endpoint_resource.go +++ b/internal/service/oda/oda_oda_private_endpoint_resource.go @@ -223,6 +223,11 @@ func (s *OdaOdaPrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOdaPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "oda"), oci_oda.WorkRequestResourceResourceActionCreate, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opa/opa_opa_instance_resource.go b/internal/service/opa/opa_opa_instance_resource.go index deead338c81..a11656f3ee5 100644 --- a/internal/service/opa/opa_opa_instance_resource.go +++ b/internal/service/opa/opa_opa_instance_resource.go @@ -293,6 +293,23 @@ func (s *OpaOpaInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_opa.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_opa.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opa"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "opa") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getOpaInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opa"), oci_opa.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opensearch/opensearch_opensearch_cluster_resource.go b/internal/service/opensearch/opensearch_opensearch_cluster_resource.go index 9b83d42fe81..8cd21ae4f8d 100644 --- a/internal/service/opensearch/opensearch_opensearch_cluster_resource.go +++ b/internal/service/opensearch/opensearch_opensearch_cluster_resource.go @@ -450,6 +450,23 @@ func (s *OpensearchOpensearchClusterResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_opensearch.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_opensearch.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opensearch"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "opensearch") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getOpensearchClusterFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opensearch"), oci_opensearch.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opsi/opsi_awr_hub_resource.go b/internal/service/opsi/opsi_awr_hub_resource.go index 6bbc3d8db53..48eaf2a65e5 100644 --- a/internal/service/opsi/opsi_awr_hub_resource.go +++ b/internal/service/opsi/opsi_awr_hub_resource.go @@ -207,6 +207,11 @@ func (s *OpsiAwrHubResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getAwrHubFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opsi/opsi_database_insight_resource.go b/internal/service/opsi/opsi_database_insight_resource.go index d43e16ab869..9528a35bcfb 100644 --- a/internal/service/opsi/opsi_database_insight_resource.go +++ b/internal/service/opsi/opsi_database_insight_resource.go @@ -411,6 +411,11 @@ func (s *OpsiDatabaseInsightResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } // Wait until it finishes databaseInsightId, err := databaseInsightWaitForWorkRequest(workId, "opsi", diff --git a/internal/service/opsi/opsi_enterprise_manager_bridge_resource.go b/internal/service/opsi/opsi_enterprise_manager_bridge_resource.go index c6b5fb2ecfe..e4bdebcd403 100644 --- a/internal/service/opsi/opsi_enterprise_manager_bridge_resource.go +++ b/internal/service/opsi/opsi_enterprise_manager_bridge_resource.go @@ -211,6 +211,11 @@ func (s *OpsiEnterpriseManagerBridgeResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getEnterpriseManagerBridgeFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opsi/opsi_exadata_insight_resource.go b/internal/service/opsi/opsi_exadata_insight_resource.go index 6b3dfb6d037..d18f93b78a4 100644 --- a/internal/service/opsi/opsi_exadata_insight_resource.go +++ b/internal/service/opsi/opsi_exadata_insight_resource.go @@ -414,6 +414,11 @@ func (s *OpsiExadataInsightResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } // Wait until it finishes exadataInsightId, err := exadataInsightWaitForWorkRequest(workId, "opsi", diff --git a/internal/service/opsi/opsi_host_insight_resource.go b/internal/service/opsi/opsi_host_insight_resource.go index 6b4feb520cd..ab9f374764e 100644 --- a/internal/service/opsi/opsi_host_insight_resource.go +++ b/internal/service/opsi/opsi_host_insight_resource.go @@ -254,6 +254,11 @@ func (s *OpsiHostInsightResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } // Wait until it finishes hostInsightId, err := hostInsightWaitForWorkRequest(workId, "opsi", diff --git a/internal/service/opsi/opsi_operations_insights_private_endpoint_resource.go b/internal/service/opsi/opsi_operations_insights_private_endpoint_resource.go index eeca3b7458d..7acc401c06b 100644 --- a/internal/service/opsi/opsi_operations_insights_private_endpoint_resource.go +++ b/internal/service/opsi/opsi_operations_insights_private_endpoint_resource.go @@ -251,6 +251,11 @@ func (s *OpsiOperationsInsightsPrivateEndpointResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOperationsInsightsPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opsi/opsi_operations_insights_warehouse_resource.go b/internal/service/opsi/opsi_operations_insights_warehouse_resource.go index 2d2aadab43c..8bd49ec8a3b 100644 --- a/internal/service/opsi/opsi_operations_insights_warehouse_resource.go +++ b/internal/service/opsi/opsi_operations_insights_warehouse_resource.go @@ -222,6 +222,11 @@ func (s *OpsiOperationsInsightsWarehouseResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOperationsInsightsWarehouseFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opsi/opsi_operations_insights_warehouse_user_resource.go b/internal/service/opsi/opsi_operations_insights_warehouse_user_resource.go index d438ecf489f..5a967e1f4d2 100644 --- a/internal/service/opsi/opsi_operations_insights_warehouse_user_resource.go +++ b/internal/service/opsi/opsi_operations_insights_warehouse_user_resource.go @@ -233,6 +233,11 @@ func (s *OpsiOperationsInsightsWarehouseUserResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOperationsInsightsWarehouseUserFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/opsi/opsi_opsi_configuration_resource.go b/internal/service/opsi/opsi_opsi_configuration_resource.go index 6614c327b9c..e2a065dbb17 100644 --- a/internal/service/opsi/opsi_opsi_configuration_resource.go +++ b/internal/service/opsi/opsi_opsi_configuration_resource.go @@ -340,6 +340,11 @@ func (s *OpsiOpsiConfigurationResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getOpsiConfigurationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/queue/queue_queue_resource.go b/internal/service/queue/queue_queue_resource.go index 6c445fb6781..bba81e8c995 100644 --- a/internal/service/queue/queue_queue_resource.go +++ b/internal/service/queue/queue_queue_resource.go @@ -268,6 +268,23 @@ func (s *QueueQueueResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_queue.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_queue.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "queue"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "queue") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getQueueFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "queue"), oci_queue.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/recovery/recovery_protected_database_resource.go b/internal/service/recovery/recovery_protected_database_resource.go index e74ab64b097..65a8abfd0e2 100644 --- a/internal/service/recovery/recovery_protected_database_resource.go +++ b/internal/service/recovery/recovery_protected_database_resource.go @@ -336,6 +336,11 @@ func (s *RecoveryProtectedDatabaseResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getProtectedDatabaseFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "recovery"), oci_recovery.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/recovery/recovery_protection_policy_resource.go b/internal/service/recovery/recovery_protection_policy_resource.go index 175a900eb6e..00f6d834374 100644 --- a/internal/service/recovery/recovery_protection_policy_resource.go +++ b/internal/service/recovery/recovery_protection_policy_resource.go @@ -195,6 +195,11 @@ func (s *RecoveryProtectionPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getProtectionPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "recovery"), oci_recovery.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/recovery/recovery_recovery_service_subnet_resource.go b/internal/service/recovery/recovery_recovery_service_subnet_resource.go index 6f33e2e72e6..5315b137b04 100644 --- a/internal/service/recovery/recovery_recovery_service_subnet_resource.go +++ b/internal/service/recovery/recovery_recovery_service_subnet_resource.go @@ -202,6 +202,11 @@ func (s *RecoveryRecoveryServiceSubnetResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getRecoveryServiceSubnetFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "recovery"), oci_recovery.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/sch/sch_service_connector_resource.go b/internal/service/sch/sch_service_connector_resource.go index f854aef3dd7..dec6af28e5f 100644 --- a/internal/service/sch/sch_service_connector_resource.go +++ b/internal/service/sch/sch_service_connector_resource.go @@ -641,6 +641,23 @@ func (s *SchServiceConnectorResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_sch.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_sch.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "sch"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "serviceconnector") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getServiceConnectorFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "sch"), oci_sch.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_access_policy_resource.go b/internal/service/service_mesh/service_mesh_access_policy_resource.go index 35edddbaaad..294e9d41f19 100644 --- a/internal/service/service_mesh/service_mesh_access_policy_resource.go +++ b/internal/service/service_mesh/service_mesh_access_policy_resource.go @@ -373,6 +373,11 @@ func (s *ServiceMeshAccessPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getAccessPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_ingress_gateway_resource.go b/internal/service/service_mesh/service_mesh_ingress_gateway_resource.go index b5eed79b4c3..0358fb715ae 100644 --- a/internal/service/service_mesh/service_mesh_ingress_gateway_resource.go +++ b/internal/service/service_mesh/service_mesh_ingress_gateway_resource.go @@ -450,6 +450,11 @@ func (s *ServiceMeshIngressGatewayResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getIngressGatewayFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_ingress_gateway_route_table_resource.go b/internal/service/service_mesh/service_mesh_ingress_gateway_route_table_resource.go index 61297db4950..777c33e4b60 100644 --- a/internal/service/service_mesh/service_mesh_ingress_gateway_route_table_resource.go +++ b/internal/service/service_mesh/service_mesh_ingress_gateway_route_table_resource.go @@ -342,6 +342,11 @@ func (s *ServiceMeshIngressGatewayRouteTableResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getIngressGatewayRouteTableFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_mesh_resource.go b/internal/service/service_mesh/service_mesh_mesh_resource.go index ff340b29da0..9e83c9b6e12 100644 --- a/internal/service/service_mesh/service_mesh_mesh_resource.go +++ b/internal/service/service_mesh/service_mesh_mesh_resource.go @@ -260,6 +260,11 @@ func (s *ServiceMeshMeshResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getMeshFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_virtual_deployment_resource.go b/internal/service/service_mesh/service_mesh_virtual_deployment_resource.go index 040bd0521ea..343a3f1c3fa 100644 --- a/internal/service/service_mesh/service_mesh_virtual_deployment_resource.go +++ b/internal/service/service_mesh/service_mesh_virtual_deployment_resource.go @@ -332,6 +332,11 @@ func (s *ServiceMeshVirtualDeploymentResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getVirtualDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_virtual_service_resource.go b/internal/service/service_mesh/service_mesh_virtual_service_resource.go index ce6fcddb4a7..d5e36c60492 100644 --- a/internal/service/service_mesh/service_mesh_virtual_service_resource.go +++ b/internal/service/service_mesh/service_mesh_virtual_service_resource.go @@ -296,6 +296,11 @@ func (s *ServiceMeshVirtualServiceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getVirtualServiceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/service_mesh/service_mesh_virtual_service_route_table_resource.go b/internal/service/service_mesh/service_mesh_virtual_service_route_table_resource.go index cef02405b16..10657b7094a 100644 --- a/internal/service/service_mesh/service_mesh_virtual_service_route_table_resource.go +++ b/internal/service/service_mesh/service_mesh_virtual_service_route_table_resource.go @@ -306,6 +306,11 @@ func (s *ServiceMeshVirtualServiceRouteTableResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getVirtualServiceRouteTableFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "service_mesh"), oci_service_mesh.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/stack_monitoring/stack_monitoring_monitored_resource_resource.go b/internal/service/stack_monitoring/stack_monitoring_monitored_resource_resource.go index 26bfe4d0acb..c5ce90ddb5c 100644 --- a/internal/service/stack_monitoring/stack_monitoring_monitored_resource_resource.go +++ b/internal/service/stack_monitoring/stack_monitoring_monitored_resource_resource.go @@ -629,6 +629,11 @@ func (s *StackMonitoringMonitoredResourceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getMonitoredResourceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "stack_monitoring"), oci_stack_monitoring.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/vbs_inst/vbs_inst_vbs_instance_resource.go b/internal/service/vbs_inst/vbs_inst_vbs_instance_resource.go index 1bb03e94b4b..af75a9821f9 100644 --- a/internal/service/vbs_inst/vbs_inst_vbs_instance_resource.go +++ b/internal/service/vbs_inst/vbs_inst_vbs_instance_resource.go @@ -227,6 +227,23 @@ func (s *VbsInstVbsInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_vbs_inst.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_vbs_inst.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vbs_inst"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "vbsinstance") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getVbsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vbs_inst"), oci_vbs_inst.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/visual_builder/visual_builder_vb_instance_resource.go b/internal/service/visual_builder/visual_builder_vb_instance_resource.go index ef995e65ba5..72488673e46 100644 --- a/internal/service/visual_builder/visual_builder_vb_instance_resource.go +++ b/internal/service/visual_builder/visual_builder_vb_instance_resource.go @@ -392,6 +392,23 @@ func (s *VisualBuilderVbInstanceResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_visual_builder.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_visual_builder.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "visual_builder"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "visualbuilder") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getVbInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "visual_builder"), oci_visual_builder.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/vn_monitoring/vn_monitoring_path_analysi_resource.go b/internal/service/vn_monitoring/vn_monitoring_path_analysi_resource.go index c3456cc0a6c..1f3ea486e22 100644 --- a/internal/service/vn_monitoring/vn_monitoring_path_analysi_resource.go +++ b/internal/service/vn_monitoring/vn_monitoring_path_analysi_resource.go @@ -363,6 +363,23 @@ func (s *VnMonitoringPathAnalysiResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_vn_monitoring.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_vn_monitoring.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vn_monitoring"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "vn_monitoring") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getPathAnalysiFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vn_monitoring"), oci_vn_monitoring.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_recipe_resource.go b/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_recipe_resource.go index 08a46c83e66..b048c8be4a4 100644 --- a/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_recipe_resource.go +++ b/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_recipe_resource.go @@ -219,6 +219,11 @@ func (s *VulnerabilityScanningContainerScanRecipeResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getContainerScanRecipeFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vulnerability_scanning"), oci_vulnerability_scanning.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_target_resource.go b/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_target_resource.go index cce8e118876..9256142892a 100644 --- a/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_target_resource.go +++ b/internal/service/vulnerability_scanning/vulnerability_scanning_container_scan_target_resource.go @@ -251,6 +251,11 @@ func (s *VulnerabilityScanningContainerScanTargetResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getContainerScanTargetFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vulnerability_scanning"), oci_vulnerability_scanning.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waa/waa_web_app_acceleration_policy_resource.go b/internal/service/waa/waa_web_app_acceleration_policy_resource.go index 1840ad06511..ff304dbd42e 100644 --- a/internal/service/waa/waa_web_app_acceleration_policy_resource.go +++ b/internal/service/waa/waa_web_app_acceleration_policy_resource.go @@ -276,6 +276,11 @@ func (s *WaaWebAppAccelerationPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getWebAppAccelerationPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waa"), oci_waa.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waa/waa_web_app_acceleration_resource.go b/internal/service/waa/waa_web_app_acceleration_resource.go index be986a96895..adbdc9bc8c0 100644 --- a/internal/service/waa/waa_web_app_acceleration_resource.go +++ b/internal/service/waa/waa_web_app_acceleration_resource.go @@ -191,6 +191,11 @@ func (s *WaaWebAppAccelerationResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getWebAppAccelerationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waa"), oci_waa.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waas/waas_http_redirect_resource.go b/internal/service/waas/waas_http_redirect_resource.go index ad28849cf48..d64195629bd 100644 --- a/internal/service/waas/waas_http_redirect_resource.go +++ b/internal/service/waas/waas_http_redirect_resource.go @@ -242,6 +242,23 @@ func (s *WaasHttpRedirectResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_waas.GetWorkRequestResponse{} + workRequestResponse, err = s.WaasClient.GetWorkRequest(context.Background(), + oci_waas.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waas"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "redirect") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getHttpRedirectFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waas"), oci_waas.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waas/waas_waas_policy_resource.go b/internal/service/waas/waas_waas_policy_resource.go index 907a3736aaf..9424a0c48ec 100644 --- a/internal/service/waas/waas_waas_policy_resource.go +++ b/internal/service/waas/waas_waas_policy_resource.go @@ -1440,6 +1440,23 @@ func (s *WaasWaasPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + workRequestResponse := oci_waas.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_waas.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waas"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "waas") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } return s.getWaasPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waas"), oci_waas.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waf/waf_network_address_list_resource.go b/internal/service/waf/waf_network_address_list_resource.go index 4f8cdf74f69..4c3cf77fa81 100644 --- a/internal/service/waf/waf_network_address_list_resource.go +++ b/internal/service/waf/waf_network_address_list_resource.go @@ -210,6 +210,11 @@ func (s *WafNetworkAddressListResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getNetworkAddressListFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waf"), oci_waf.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waf/waf_web_app_firewall_policy_resource.go b/internal/service/waf/waf_web_app_firewall_policy_resource.go index b093fd4a1e3..44aff8c63be 100644 --- a/internal/service/waf/waf_web_app_firewall_policy_resource.go +++ b/internal/service/waf/waf_web_app_firewall_policy_resource.go @@ -933,6 +933,11 @@ func (s *WafWebAppFirewallPolicyResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } return s.getWebAppFirewallPolicyFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waf"), oci_waf.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/service/waf/waf_web_app_firewall_resource.go b/internal/service/waf/waf_web_app_firewall_resource.go index 3ab63c8de79..3dbdd79ac40 100644 --- a/internal/service/waf/waf_web_app_firewall_resource.go +++ b/internal/service/waf/waf_web_app_firewall_resource.go @@ -187,6 +187,11 @@ func (s *WafWebAppFirewallResourceCrud) Create() error { } workId := response.OpcWorkRequestId + var identifier *string + identifier = response.GetId() + if identifier != nil { + s.D.SetId(*identifier) + } return s.getWebAppFirewallFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "waf"), oci_waf.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } diff --git a/internal/tfresource/crud_helpers.go b/internal/tfresource/crud_helpers.go index b8c94f24f66..72c93f51c46 100644 --- a/internal/tfresource/crud_helpers.go +++ b/internal/tfresource/crud_helpers.go @@ -908,6 +908,32 @@ func WaitForWorkRequest(workRequestClient workReqClient, workRequestId *string, return identifier, nil } +func GetResourceIDFromWorkRequest(workRequestClient workReqClient, workRequestId *string, entityType string, + disableFoundRetries bool) *string { + retryPolicy := GetRetryPolicy(disableFoundRetries, "work_request") + + response := oci_work_requests.GetWorkRequestResponse{} + var err error + response, err = workRequestClient.GetWorkRequest(context.Background(), + oci_work_requests.GetWorkRequestRequest{ + WorkRequestId: workRequestId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return nil + } + var identifier *string + for _, res := range response.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), entityType) { + identifier = res.Identifier + break + } + } + + return identifier +} func workRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { startTime := time.Now() stopTime := startTime.Add(timeout) diff --git a/internal/tfresource/crud_helpers_test.go b/internal/tfresource/crud_helpers_test.go index eefd3aa9aad..bf8af2cc648 100644 --- a/internal/tfresource/crud_helpers_test.go +++ b/internal/tfresource/crud_helpers_test.go @@ -264,6 +264,8 @@ type mockWorkRequestClient struct{} func (client *mockWorkRequestClient) GetWorkRequest(_ context.Context, wreq oci_work_requests.GetWorkRequestRequest) (response oci_work_requests.GetWorkRequestResponse, err error) { var v oci_work_requests.GetWorkRequestResponse + err = nil + switch *wreq.WorkRequestId { case "1": s := "" @@ -286,6 +288,14 @@ func (client *mockWorkRequestClient) GetWorkRequest(_ context.Context, wreq oci_ r := []oci_work_requests.WorkRequestResource{{EntityType: &et, Identifier: &id, ActionType: "CREATED"}} wr := oci_work_requests.WorkRequest{Status: "CANCELED", Resources: r} v = oci_work_requests.GetWorkRequestResponse{RawResponse: nil, WorkRequest: wr, OpcRequestId: &s} + case "4": // Error scenario + s := "" + et := "" + id := "" + r := []oci_work_requests.WorkRequestResource{{EntityType: &et, Identifier: &id, ActionType: "CREATED"}} + wr := oci_work_requests.WorkRequest{Status: "ABC", Resources: r} + v = oci_work_requests.GetWorkRequestResponse{RawResponse: nil, WorkRequest: wr, OpcRequestId: &s} + err = fmt.Errorf("get request failed") default: s := "" et := "default" @@ -294,7 +304,7 @@ func (client *mockWorkRequestClient) GetWorkRequest(_ context.Context, wreq oci_ wr := oci_work_requests.WorkRequest{Status: "SUCCEEDED", Resources: r} v = oci_work_requests.GetWorkRequestResponse{RawResponse: nil, WorkRequest: wr, OpcRequestId: &s} } - return v, nil + return v, err } func (client *mockWorkRequestClient) ListWorkRequestErrors(_ context.Context, _ oci_work_requests.ListWorkRequestErrorsRequest) (response oci_work_requests.ListWorkRequestErrorsResponse, err error) { s := "default" @@ -1499,6 +1509,55 @@ func TestUnitWaitForWorkRequest(t *testing.T) { } } +func TestUnitGetResourceIDFromWorkRequest(t *testing.T) { + type output struct { + identifier string + } + type args struct { + workRequestClient *mockWorkRequestClient + workRequestId *string + entityType string + disableFoundRetries bool + } + type testFormat struct { + name string + args args + output output + } + workReqId1 := "1" + workReqId2 := "2" + workReqId4 := "4" + tests := []testFormat{ + { + name: "Test correct entityType", + args: args{workRequestClient: &mockWorkRequestClient{}, workRequestId: &workReqId1, entityType: "default", disableFoundRetries: false}, + output: output{identifier: "oci"}, + }, + { + name: "Test incorrect entityType", + args: args{workRequestClient: &mockWorkRequestClient{}, workRequestId: &workReqId1, entityType: "default1", disableFoundRetries: false}, + output: output{identifier: ""}, + }, + { + name: "Test empty identifier", + args: args{workRequestClient: &mockWorkRequestClient{}, workRequestId: &workReqId2, entityType: "default", disableFoundRetries: false}, + output: output{identifier: ""}, + }, + { + name: "Test error returned", + args: args{workRequestClient: &mockWorkRequestClient{}, workRequestId: &workReqId4, entityType: "default", disableFoundRetries: false}, + output: output{identifier: ""}, + }, + } + for _, test := range tests { + t.Logf("Running %s", test.name) + id := GetResourceIDFromWorkRequest(test.args.workRequestClient, test.args.workRequestId, test.args.entityType, test.args.disableFoundRetries) + if id != nil && *id != test.output.identifier { + t.Errorf("Output string - %s is not equal to expected string - %s", *id, test.output.identifier) + } + } +} + func TestUnitgetWorkRequestErrors(t *testing.T) { type args struct { workRequestClient *mockWorkRequestClient From f8daea2f5e59e56246736008380411b16fcd5e58 Mon Sep 17 00:00:00 2001 From: Terraform Team Automation Date: Fri, 19 May 2023 05:07:48 +0000 Subject: [PATCH 02/16] Bug Fix - adding fix for cloudguard detector rule condition paramter unmarshalling issue --- .../cloud_guard_detector_recipe_test.go | 80 +++++++++++++++++++ .../cloud_guard_detector_recipe_resource.go | 45 +++++++++-- 2 files changed, 120 insertions(+), 5 deletions(-) diff --git a/internal/integrationtest/cloud_guard_detector_recipe_test.go b/internal/integrationtest/cloud_guard_detector_recipe_test.go index 487b27bb676..a5488e7437f 100644 --- a/internal/integrationtest/cloud_guard_detector_recipe_test.go +++ b/internal/integrationtest/cloud_guard_detector_recipe_test.go @@ -360,6 +360,86 @@ func TestCloudGuardDetectorRecipeResource_basic(t *testing.T) { }) } +func TestCloudGuardDetectorRecipeResource_updateOptionalParamsWithoutDestroy(t *testing.T) { + httpreplay.SetScenario("TestCloudGuardDetectorRecipeResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_cloud_guard_detector_recipe.test_detector_recipe" + 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+CloudGuardDetectorRecipeResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_cloud_guard_detector_recipe", "test_detector_recipe", acctest.Optional, acctest.Create, CloudGuardDetectorRecipeRepresentation), "cloudguard", "detectorRecipe", t) + + acctest.ResourceTest(t, testAccCheckCloudGuardDetectorRecipeDestroy, []resource.TestStep{ + // verify Create Recipe + { + Config: config + compartmentIdVariableStr + CloudGuardDetectorRecipeResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_cloud_guard_detector_recipe", "test_detector_recipe", acctest.Required, acctest.Create, CloudGuardDetectorRecipeRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttrSet(resourceName, "source_detector_recipe_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + CloudGuardDetectorRecipeResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_cloud_guard_detector_recipe", "test_detector_recipe", acctest.Optional, acctest.Create, CloudGuardDetectorRecipeRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "detector", "IAAS_CONFIGURATION_DETECTOR"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.#", "1"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.#", "1"), + //Just checking it being set, it being a JSON + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.condition", "{\"kind\":\"SIMPLE\",\"parameter\":\"lbCertificateExpiringSoonFilter\",\"value\":\"10\",\"operator\":\"EQUALS\",\"valueType\":\"CUSTOM\"}"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.#", "1"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.config_key", "lbCertificateExpiringSoonConfig"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.data_type", "int"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.name", "Days before expiring"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.value", "30"), + // Configuration values will be set only if data_type is complex such as multiList + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.values.#", "0"), + //resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.values.0.list_type", "CUSTOM"), + //resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.values.0.managed_list_type", "RESOURCE_OCID"), + //resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.configurations.0.values.0.value", "resourceOcid1"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.is_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.labels.#", "1"), + resource.TestCheckResourceAttr(resourceName, "detector_rules.0.details.0.risk_level", "CRITICAL"), + resource.TestCheckResourceAttrSet(resourceName, "detector_rules.0.detector"), + resource.TestCheckResourceAttrSet(resourceName, "detector_rules.0.detector_rule_id"), + resource.TestCheckResourceAttrSet(resourceName, "detector_rules.0.resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "detector_rules.0.service_type"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "owner"), + resource.TestCheckResourceAttrSet(resourceName, "source_detector_recipe_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 + }, + ), + }, + }) +} + func testAccCheckCloudGuardDetectorRecipeDestroy(s *terraform.State) error { noResourceFound := true client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).CloudGuardClient() diff --git a/internal/service/cloud_guard/cloud_guard_detector_recipe_resource.go b/internal/service/cloud_guard/cloud_guard_detector_recipe_resource.go index 4d29b265f67..21eefb95492 100644 --- a/internal/service/cloud_guard/cloud_guard_detector_recipe_resource.go +++ b/internal/service/cloud_guard/cloud_guard_detector_recipe_resource.go @@ -6,7 +6,9 @@ package cloud_guard import ( "context" "encoding/json" + "errors" "fmt" + "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -1118,12 +1120,13 @@ func (s *CloudGuardDetectorRecipeResourceCrud) mapToUpdateDetectorRuleDetails(fi //Condition Modelling if condition, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "condition")); ok { tmp := condition.(string) - var conditionObj oci_cloud_guard.Condition - err := json.Unmarshal([]byte(tmp), &conditionObj) - if err != nil { - return result, err + if len(strings.TrimSpace(tmp)) > 0 { + var err error + result.Condition, err = jsonToCondition(tmp) + if err != nil { + return result, err + } } - result.Condition = &conditionObj } if configurations, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "configurations")); ok { @@ -1200,6 +1203,38 @@ func (s *CloudGuardDetectorRecipeResourceCrud) mapToUpdateDetectorRuleDetails(fi return result, nil } +func jsonToCondition(data string) (oci_cloud_guard.Condition, error) { + var val cloudGuardCondition + var err error + if err := json.Unmarshal([]byte(data), &val); err == nil { + if schemaData, err := UnmarshalPolymorphicConditionJSON(val.Kind, data); err == nil { + return schemaData, nil + } + } + return nil, err +} + +type cloudGuardCondition struct { + JsonData []byte + Kind string `json:"kind"` +} + +func UnmarshalPolymorphicConditionJSON(kind string, data string) (oci_cloud_guard.Condition, error) { + var err error + switch kind { + case "SIMPLE": + mm := oci_cloud_guard.SimpleCondition{} + err = json.Unmarshal([]byte(data), &mm) + return mm, err + case "COMPOSITE": + mm := oci_cloud_guard.CompositeCondition{} + err = json.Unmarshal([]byte(data), &mm) + return mm, err + default: + return nil, errors.New(fmt.Sprintf("Recieved unsupported enum value for Condition : %s.", kind)) + } +} + func (s *CloudGuardDetectorRecipeResourceCrud) updateCompartment(compartment interface{}) error { changeCompartmentRequest := oci_cloud_guard.ChangeDetectorRecipeCompartmentRequest{} From 8d63d396974dcc470a48f807aba2f4c0d4f586ec Mon Sep 17 00:00:00 2001 From: Terraform Team Automation Date: Fri, 19 May 2023 05:30:08 +0000 Subject: [PATCH 03/16] Added - Support for Create oci_dns_rrsets data source --- examples/dns/global/rrset.tf | 5 + examples/dns/private/rrset/rrset.tf | 7 + internal/integrationtest/dns_rrset_test.go | 38 ++- internal/service/dns/dns_export.go | 3 +- .../service/dns/dns_records_data_source.go | 2 +- .../service/dns/dns_rrsets_data_source.go | 222 ++++++++++++++++++ internal/service/dns/register_datasource.go | 1 + website/docs/d/dns_records.html.markdown | 2 +- website/docs/d/dns_rrsets.html.markdown | 67 ++++++ 9 files changed, 342 insertions(+), 5 deletions(-) create mode 100644 internal/service/dns/dns_rrsets_data_source.go create mode 100644 website/docs/d/dns_rrsets.html.markdown diff --git a/examples/dns/global/rrset.tf b/examples/dns/global/rrset.tf index 96ad22a713e..d1b643363bb 100644 --- a/examples/dns/global/rrset.tf +++ b/examples/dns/global/rrset.tf @@ -50,3 +50,8 @@ data "oci_dns_rrset" "test_rrset" { zone_name_or_id = oci_dns_zone.zone3.id } +data "oci_dns_rrsets" "test_rrsets" { + domain = "el.${oci_dns_zone.zone3.name}" + rtype = "CNAME" + zone_name_or_id = oci_dns_zone.zone3.id +} diff --git a/examples/dns/private/rrset/rrset.tf b/examples/dns/private/rrset/rrset.tf index 9a7720bde06..1b86f1a5546 100644 --- a/examples/dns/private/rrset/rrset.tf +++ b/examples/dns/private/rrset/rrset.tf @@ -65,3 +65,10 @@ data "oci_dns_rrset" "test_rrset" { view_id = oci_dns_view.test_view.id } +data "oci_dns_rrsets" "test_rrsets" { + domain = "el.${oci_dns_zone.zone3.name}" + rtype = "CNAME" + zone_name_or_id = oci_dns_zone.zone3.id + scope = "PRIVATE" + view_id = oci_dns_view.test_view.id +} diff --git a/internal/integrationtest/dns_rrset_test.go b/internal/integrationtest/dns_rrset_test.go index e57d4f93d79..24048b4f5df 100644 --- a/internal/integrationtest/dns_rrset_test.go +++ b/internal/integrationtest/dns_rrset_test.go @@ -39,7 +39,16 @@ var ( "view_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_dns_view.test_view.id}`}, } - dnsDomainName = utils.RandomString(5, utils.CharsetWithoutDigits) + ".token.oci-record-test" + DnsDnsRrsetDataSourceRepresentation = map[string]interface{}{ + "domain": acctest.Representation{RepType: acctest.Required, Create: dnsDomainName}, + "zone_name_or_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_dns_zone.test_zone.id}`}, + "rtype": acctest.Representation{RepType: acctest.Required, Create: `A`}, + "scope": acctest.Representation{RepType: acctest.Required, Create: `PRIVATE`}, + "view_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_dns_view.test_view.id}`}, + } + + dnsDomainName = utils.RandomString(5, utils.CharsetWithoutDigits) + ".token.oci-record-test" + DnsRrsetRepresentation = map[string]interface{}{ "domain": acctest.Representation{RepType: acctest.Required, Create: dnsDomainName}, "rtype": acctest.Representation{RepType: acctest.Required, Create: `A`}, @@ -75,7 +84,7 @@ func TestDnsRrsetResource_basic(t *testing.T) { compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) resourceName := "oci_dns_rrset.test_rrset" - + datasourceName := "data.oci_dns_rrsets.test_rrsets" singularDatasourceName := "data.oci_dns_rrset.test_rrset" var resId, resId2 string @@ -166,6 +175,31 @@ func TestDnsRrsetResource_basic(t *testing.T) { }, ), }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_dns_rrsets", "test_rrsets", acctest.Optional, acctest.Update, DnsDnsRrsetDataSourceRepresentation) + + compartmentIdVariableStr + DnsRrsetResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_dns_rrset", "test_rrset", acctest.Optional, acctest.Update, DnsRrsetRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + + resource.TestCheckResourceAttr(datasourceName, "rrsets.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "rrsets.0.items.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "rrsets.0.domain", dnsDomainName), + resource.TestCheckResourceAttr(datasourceName, "rrsets.0.rtype", "A"), + acctest.CheckResourceSetContainsElementWithProperties(datasourceName, "rrsets.0.items", map[string]string{ + "domain": dnsDomainName, + "rdata": "77.77.77.77", + "rtype": "A", + "ttl": "1000", + }, + []string{ + "is_protected", + "record_hash", + "rrset_version", + }), + ), + }, // verify singular datasource { Config: config + diff --git a/internal/service/dns/dns_export.go b/internal/service/dns/dns_export.go index 13517a025d8..d507f2a6842 100644 --- a/internal/service/dns/dns_export.go +++ b/internal/service/dns/dns_export.go @@ -254,7 +254,8 @@ var exportDnsTsigKeyHints = &tf_export.TerraformResourceHints{ var exportDnsRrsetHints = &tf_export.TerraformResourceHints{ ResourceClass: "oci_dns_rrset", - DatasourceClass: "oci_dns_rrset", + DatasourceClass: "oci_dns_rrsets", + DatasourceItemsAttr: "rrsets", ResourceAbbreviation: "rrset", } diff --git a/internal/service/dns/dns_records_data_source.go b/internal/service/dns/dns_records_data_source.go index b4da69c8901..0e0c82015cd 100644 --- a/internal/service/dns/dns_records_data_source.go +++ b/internal/service/dns/dns_records_data_source.go @@ -23,7 +23,7 @@ func DnsRecordsDataSource() *schema.Resource { "zone_name_or_id": { Type: schema.TypeString, Required: true, - Deprecated: tfresource.ResourceDeprecatedForAnother("oci_dns_records", "oci_dns_rrset"), + Deprecated: tfresource.ResourceDeprecatedForAnother("oci_dns_records", "oci_dns_rrsets"), }, // Optional diff --git a/internal/service/dns/dns_rrsets_data_source.go b/internal/service/dns/dns_rrsets_data_source.go new file mode 100644 index 00000000000..aea390ba289 --- /dev/null +++ b/internal/service/dns/dns_rrsets_data_source.go @@ -0,0 +1,222 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package dns + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_dns "github.com/oracle/oci-go-sdk/v65/dns" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DnsRrsetsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readDnsRrsets, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "domain": { + Type: schema.TypeString, + Optional: true, + }, + "domain_contains": { + Type: schema.TypeString, + Optional: true, + }, + "rtype": { + Type: schema.TypeString, + Optional: true, + }, + "scope": { + Type: schema.TypeString, + Optional: true, + }, + "view_id": { + Type: schema.TypeString, + Optional: true, + }, + "zone_name_or_id": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "rrsets": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "domain": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + }, + "rtype": { + Type: schema.TypeString, + Required: true, + }, + "items": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "domain": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + }, + "rdata": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + rtype := d.Get("rtype").(string) + return normalizeRData(rtype, new) == normalizeRData(rtype, old) + }, + }, + "rtype": { + Type: schema.TypeString, + Required: true, + }, + "ttl": { + Type: schema.TypeInt, + Required: true, + }, + + // Optional + + // Computed + "is_protected": { + Type: schema.TypeBool, + Computed: true, + }, + "record_hash": { + Type: schema.TypeString, + Computed: true, + }, + "rrset_version": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readDnsRrsets(d *schema.ResourceData, m interface{}) error { + sync := &DnsRrsetsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DnsClient() + + return tfresource.ReadResource(sync) +} + +type DnsRrsetsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_dns.DnsClient + Res *oci_dns.GetZoneRecordsResponse +} + +func (s *DnsRrsetsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DnsRrsetsDataSourceCrud) Get() error { + request := oci_dns.GetZoneRecordsRequest{} + + if domain, ok := s.D.GetOkExists("domain"); ok { + tmp := domain.(string) + request.Domain = &tmp + } + + if domainContains, ok := s.D.GetOkExists("domain_contains"); ok { + tmp := domainContains.(string) + request.DomainContains = &tmp + } + + if rtype, ok := s.D.GetOkExists("rtype"); ok { + tmp := rtype.(string) + request.Rtype = &tmp + } + + if scope, ok := s.D.GetOkExists("scope"); ok { + request.Scope = oci_dns.GetZoneRecordsScopeEnum(scope.(string)) + } + + if viewId, ok := s.D.GetOkExists("view_id"); ok { + tmp := viewId.(string) + request.ViewId = &tmp + } + + if zoneNameOrId, ok := s.D.GetOkExists("zone_name_or_id"); ok { + tmp := zoneNameOrId.(string) + request.ZoneNameOrId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "dns") + + response, err := s.Client.GetZoneRecords(context.Background(), request) + if err != nil { + return err + } + + request.Page = response.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.GetZoneRecords(context.Background(), request) + if err != nil { + return err + } + + response.Items = append(response.Items, listResponse.Items...) + request.Page = listResponse.OpcNextPage + } + + s.Res = &response + return nil +} + +func (s *DnsRrsetsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DnsRrsetsDataSource-", DnsRrsetsDataSource(), s.D)) + + rrsetMap := map[string]map[string][]oci_dns.Record{} + + for _, record := range s.Res.Items { + if _, ok := rrsetMap[*record.Domain]; !ok { + rrsetMap[*record.Domain] = map[string][]oci_dns.Record{} + } + if _, ok := rrsetMap[*record.Domain][*record.Rtype]; !ok { + rrsetMap[*record.Domain][*record.Rtype] = []oci_dns.Record{} + } + rrsetMap[*record.Domain][*record.Rtype] = append(rrsetMap[*record.Domain][*record.Rtype], record) + } + + rrsets := []interface{}{} + for domain, domainRrsets := range rrsetMap { + for rtype, rrset := range domainRrsets { + rrsetMap := map[string]interface{}{} + rrsetMap["domain"] = domain + rrsetMap["rtype"] = rtype + records := []interface{}{} + for _, record := range rrset { + records = append(records, RecordToMap(record)) + } + rrsetMap["items"] = records + rrsets = append(rrsets, rrsetMap) + } + } + s.D.Set("rrsets", rrsets) + + return nil +} diff --git a/internal/service/dns/register_datasource.go b/internal/service/dns/register_datasource.go index f4da4e372eb..1b35d3d51dc 100644 --- a/internal/service/dns/register_datasource.go +++ b/internal/service/dns/register_datasource.go @@ -12,6 +12,7 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_dns_resolver_endpoints", DnsResolverEndpointsDataSource()) tfresource.RegisterDatasource("oci_dns_resolvers", DnsResolversDataSource()) tfresource.RegisterDatasource("oci_dns_rrset", DnsRrsetDataSource()) + tfresource.RegisterDatasource("oci_dns_rrsets", DnsRrsetsDataSource()) tfresource.RegisterDatasource("oci_dns_steering_policies", DnsSteeringPoliciesDataSource()) tfresource.RegisterDatasource("oci_dns_steering_policy", DnsSteeringPolicyDataSource()) tfresource.RegisterDatasource("oci_dns_steering_policy_attachment", DnsSteeringPolicyAttachmentDataSource()) diff --git a/website/docs/d/dns_records.html.markdown b/website/docs/d/dns_records.html.markdown index d8e9ba81bf6..8b6f934c69b 100644 --- a/website/docs/d/dns_records.html.markdown +++ b/website/docs/d/dns_records.html.markdown @@ -9,7 +9,7 @@ description: |- # Data Source: oci_dns_records -**Deprecated. Use [oci_dns_rrset](https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/dns_rrset) instead.** +**Deprecated. Use [oci_dns_rrsets](https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/dns_rrsets) instead.** This data source provides the list of Records in Oracle Cloud Infrastructure DNS service. diff --git a/website/docs/d/dns_rrsets.html.markdown b/website/docs/d/dns_rrsets.html.markdown new file mode 100644 index 00000000000..cb07db10897 --- /dev/null +++ b/website/docs/d/dns_rrsets.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "DNS" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_dns_rrsets" +sidebar_current: "docs-oci-datasource-dns-rrsets" +description: |- + Provides the list of Rrsets in Oracle Cloud Infrastructure DNS service +--- + +# Data Source: oci_dns_rrsets +This data source provides the list of RRsets in Oracle Cloud Infrastructure DNS service. + +Gets a list of all rrsets in the specified zone. You can optionally filter the results using the listed parameters. +For private zones, the scope query parameter is required with a value of `PRIVATE`. When the zone name is +provided as a path parameter and `PRIVATE` is used for the scope query parameter then the viewId query +parameter is required. + + +## Example Usage + +```hcl +data "oci_dns_rrsets" "test_rrsets" { + #Required + zone_name_or_id = oci_dns_zone.test_zone.id + + #Optional + domain = var.rrset_domain + domain_contains = var.rrset_domain + rtype = var.rrset_rtype + scope = var.rrset_scope + view_id = oci_dns_view.test_view.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `domain` - (Optional) The target fully-qualified domain name (FQDN) within the target zone. +* `domain_contains` - (Optional) Matches any rrset whose fully-qualified domain name (FQDN) contains the provided value. +* `rtype` - (Optional) Search by record type. Will match any record whose [type](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4) (case-insensitive) equals the provided value. +* `scope` - (Optional) Specifies to operate only on resources that have a matching DNS scope. +* `view_id` - (Optional) The OCID of the view the resource is associated with. +* `zone_name_or_id` - (Required) The name or OCID of the target zone. + + +## Attributes Reference + +The following attributes are exported: + +* `rrsets` - The list of rrsets. + +### Rrset Reference + +The following attributes are exported: + +* `domain` - The fully qualified domain name where the record can be located. +* `rtype` - The type of DNS record, such as A or CNAME. For more information, see [Resource Record (RR) TYPEs](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4). +* `items` - + * `domain` - The fully qualified domain name where the record can be located. + * `is_protected` - A Boolean flag indicating whether or not parts of the record are unable to be explicitly managed. + * `rdata` - The record's data, as whitespace-delimited tokens in type-specific presentation format. All RDATA is normalized and the returned presentation of your RDATA may differ from its initial input. For more information about RDATA, see [Supported DNS Resource Record Types](https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm) + * `record_hash` - A unique identifier for the record within its zone. + * `rrset_version` - The latest version of the record's zone in which its RRSet differs from the preceding version. + * `rtype` - The type of DNS record, such as A or CNAME. For more information, see [Resource Record (RR) TYPEs](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4). + * `ttl` - The Time To Live for the record, in seconds. + From f029f7cc573f0855da28f19fdf6c852fc38168af Mon Sep 17 00:00:00 2001 From: Terraform Team Automation Date: Fri, 19 May 2023 05:50:35 +0000 Subject: [PATCH 04/16] Bug Fix : Remove system tags from SZ requests --- examples/cloudguard/security_zone/security_zone.tf | 4 ---- .../security_zone_recipe/security_zone_recipe.tf | 4 ---- .../cloud_guard_security_recipe_test.go | 5 ----- .../cloud_guard_security_zone_test.go | 5 ----- .../cloud_guard_security_policies_data_source.go | 9 --------- .../cloud_guard_security_policy_data_source.go | 13 ------------- .../cloud_guard_security_recipe_data_source.go | 4 ---- .../cloud_guard_security_recipe_resource.go | 13 ------------- .../cloud_guard_security_zone_data_source.go | 4 ---- .../cloud_guard_security_zone_resource.go | 13 ------------- .../d/cloud_guard_security_policies.html.markdown | 1 - .../d/cloud_guard_security_policy.html.markdown | 1 - .../d/cloud_guard_security_recipe.html.markdown | 1 - .../d/cloud_guard_security_recipes.html.markdown | 1 - .../docs/d/cloud_guard_security_zone.html.markdown | 1 - .../docs/d/cloud_guard_security_zones.html.markdown | 1 - .../r/cloud_guard_security_recipe.html.markdown | 1 - .../docs/r/cloud_guard_security_zone.html.markdown | 1 - 18 files changed, 82 deletions(-) diff --git a/examples/cloudguard/security_zone/security_zone.tf b/examples/cloudguard/security_zone/security_zone.tf index dd71fe6764d..058ec55cc32 100644 --- a/examples/cloudguard/security_zone/security_zone.tf +++ b/examples/cloudguard/security_zone/security_zone.tf @@ -77,8 +77,4 @@ resource "oci_cloud_guard_security_zone" "test_security_zone" { #Optional description = "${var.security_zone_description}" - //Added only because we are testing this in a splat-disabled env - lifecycle { - ignore_changes = [system_tags] - } } diff --git a/examples/cloudguard/security_zone_recipe/security_zone_recipe.tf b/examples/cloudguard/security_zone_recipe/security_zone_recipe.tf index 569a0167892..9fc274a5b04 100644 --- a/examples/cloudguard/security_zone_recipe/security_zone_recipe.tf +++ b/examples/cloudguard/security_zone_recipe/security_zone_recipe.tf @@ -66,8 +66,4 @@ resource "oci_cloud_guard_security_recipe" "test_security_recipe" { #Optional description = "${var.security_recipe_description}" - //Added only because we are testing this in a splat-disabled env - lifecycle { - ignore_changes = [system_tags] - } } \ No newline at end of file diff --git a/internal/integrationtest/cloud_guard_security_recipe_test.go b/internal/integrationtest/cloud_guard_security_recipe_test.go index ac3a5df2490..2e526e24025 100644 --- a/internal/integrationtest/cloud_guard_security_recipe_test.go +++ b/internal/integrationtest/cloud_guard_security_recipe_test.go @@ -53,11 +53,6 @@ var ( "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, - "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreSecurityRecipeSystemTagsChangesRep}, - } - - ignoreSecurityRecipeSystemTagsChangesRep = map[string]interface{}{ - "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`system_tags`}}, } CloudGuardSecurityRecipeResourceDependencies = DefinedTagsDependencies + SecurityPolicyResourceDependencies diff --git a/internal/integrationtest/cloud_guard_security_zone_test.go b/internal/integrationtest/cloud_guard_security_zone_test.go index 674532aa794..b920fc6b5f6 100644 --- a/internal/integrationtest/cloud_guard_security_zone_test.go +++ b/internal/integrationtest/cloud_guard_security_zone_test.go @@ -55,11 +55,6 @@ var ( "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, - "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreSecurityZoneSystemTagsChangesRep}, - } - - ignoreSecurityZoneSystemTagsChangesRep = map[string]interface{}{ - "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`system_tags`}}, } CloudGuardSecurityZoneResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_cloud_guard_security_recipe", "test_security_recipe", acctest.Required, acctest.Create, CloudGuardSecurityRecipeRepresentation) + diff --git a/internal/service/cloud_guard/cloud_guard_security_policies_data_source.go b/internal/service/cloud_guard/cloud_guard_security_policies_data_source.go index f82230eea50..b6501dac57e 100644 --- a/internal/service/cloud_guard/cloud_guard_security_policies_data_source.go +++ b/internal/service/cloud_guard/cloud_guard_security_policies_data_source.go @@ -102,11 +102,6 @@ func CloudGuardSecurityPoliciesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "system_tags": { - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeString, - }, "time_created": { Type: schema.TypeString, Computed: true, @@ -259,10 +254,6 @@ func SecurityPolicySummaryToMap(obj oci_cloud_guard.SecurityPolicySummary) map[s result["state"] = string(obj.LifecycleState) - if obj.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) - } - if obj.TimeCreated != nil { result["time_created"] = obj.TimeCreated.String() } diff --git a/internal/service/cloud_guard/cloud_guard_security_policy_data_source.go b/internal/service/cloud_guard/cloud_guard_security_policy_data_source.go index 262b7fb2c35..b692649d251 100644 --- a/internal/service/cloud_guard/cloud_guard_security_policy_data_source.go +++ b/internal/service/cloud_guard/cloud_guard_security_policy_data_source.go @@ -71,11 +71,6 @@ func CloudGuardSecurityPolicyDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "system_tags": { - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeString, - }, "time_created": { Type: schema.TypeString, Computed: true, @@ -168,10 +163,6 @@ func (s *CloudGuardSecurityPolicyDataSourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) - if s.Res.SystemTags != nil { - s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) - } - if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } @@ -226,10 +217,6 @@ func CloudGuardSecurityPolicySummaryToMap(obj oci_cloud_guard.SecurityPolicySumm result["state"] = string(obj.LifecycleState) - if obj.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) - } - if obj.TimeCreated != nil { result["time_created"] = obj.TimeCreated.String() } diff --git a/internal/service/cloud_guard/cloud_guard_security_recipe_data_source.go b/internal/service/cloud_guard/cloud_guard_security_recipe_data_source.go index 966dad51648..6e59b370c1f 100644 --- a/internal/service/cloud_guard/cloud_guard_security_recipe_data_source.go +++ b/internal/service/cloud_guard/cloud_guard_security_recipe_data_source.go @@ -94,10 +94,6 @@ func (s *CloudGuardSecurityRecipeDataSourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) - if s.Res.SystemTags != nil { - s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) - } - if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } diff --git a/internal/service/cloud_guard/cloud_guard_security_recipe_resource.go b/internal/service/cloud_guard/cloud_guard_security_recipe_resource.go index a363cb53043..cfa3c287aac 100644 --- a/internal/service/cloud_guard/cloud_guard_security_recipe_resource.go +++ b/internal/service/cloud_guard/cloud_guard_security_recipe_resource.go @@ -75,11 +75,6 @@ func CloudGuardSecurityRecipeResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "system_tags": { - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeString, - }, "time_created": { Type: schema.TypeString, Computed: true, @@ -333,10 +328,6 @@ func (s *CloudGuardSecurityRecipeResourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) - if s.Res.SystemTags != nil { - s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) - } - if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } @@ -383,10 +374,6 @@ func SecurityRecipeSummaryToMap(obj oci_cloud_guard.SecurityRecipeSummary) map[s result["state"] = string(obj.LifecycleState) - if obj.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) - } - if obj.TimeCreated != nil { result["time_created"] = obj.TimeCreated.String() } diff --git a/internal/service/cloud_guard/cloud_guard_security_zone_data_source.go b/internal/service/cloud_guard/cloud_guard_security_zone_data_source.go index b6329eb0daf..ccae444d92c 100644 --- a/internal/service/cloud_guard/cloud_guard_security_zone_data_source.go +++ b/internal/service/cloud_guard/cloud_guard_security_zone_data_source.go @@ -100,10 +100,6 @@ func (s *CloudGuardSecurityZoneDataSourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) - if s.Res.SystemTags != nil { - s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) - } - if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } diff --git a/internal/service/cloud_guard/cloud_guard_security_zone_resource.go b/internal/service/cloud_guard/cloud_guard_security_zone_resource.go index 4ef436c95bb..c3feed96d88 100644 --- a/internal/service/cloud_guard/cloud_guard_security_zone_resource.go +++ b/internal/service/cloud_guard/cloud_guard_security_zone_resource.go @@ -79,11 +79,6 @@ func CloudGuardSecurityZoneResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "system_tags": { - Type: schema.TypeMap, - Computed: true, - Elem: schema.TypeString, - }, "time_created": { Type: schema.TypeString, Computed: true, @@ -327,10 +322,6 @@ func (s *CloudGuardSecurityZoneResourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) - if s.Res.SystemTags != nil { - s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) - } - if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } @@ -377,10 +368,6 @@ func SecurityZoneSummaryToMap(obj oci_cloud_guard.SecurityZoneSummary) map[strin result["state"] = string(obj.LifecycleState) - if obj.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) - } - if obj.TimeCreated != nil { result["time_created"] = obj.TimeCreated.String() } diff --git a/website/docs/d/cloud_guard_security_policies.html.markdown b/website/docs/d/cloud_guard_security_policies.html.markdown index f8eba4fab2f..5e8607165fa 100644 --- a/website/docs/d/cloud_guard_security_policies.html.markdown +++ b/website/docs/d/cloud_guard_security_policies.html.markdown @@ -61,7 +61,6 @@ The following attributes are exported: * `owner` - The owner of the security policy * `services` - The list of services that the security policy protects * `state` - The current state of the security policy -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the security policy was created. An RFC3339 formatted datetime string. * `time_updated` - The time the security policy was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/d/cloud_guard_security_policy.html.markdown b/website/docs/d/cloud_guard_security_policy.html.markdown index 074b1d4ccdf..04983d95e1f 100644 --- a/website/docs/d/cloud_guard_security_policy.html.markdown +++ b/website/docs/d/cloud_guard_security_policy.html.markdown @@ -46,7 +46,6 @@ The following attributes are exported: * `owner` - The owner of the security policy * `services` - The list of services that the security policy protects * `state` - The current state of the security policy -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the security policy was created. An RFC3339 formatted datetime string. * `time_updated` - The time the security policy was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/d/cloud_guard_security_recipe.html.markdown b/website/docs/d/cloud_guard_security_recipe.html.markdown index b7151a161a6..8785edf5eb3 100644 --- a/website/docs/d/cloud_guard_security_recipe.html.markdown +++ b/website/docs/d/cloud_guard_security_recipe.html.markdown @@ -44,7 +44,6 @@ The following attributes are exported: * `owner` - The owner of the recipe * `security_policies` - The list of `SecurityPolicy` ids that are included in the recipe * `state` - The current state of the recipe -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the recipe was created. An RFC3339 formatted datetime string. * `time_updated` - The time the recipe was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/d/cloud_guard_security_recipes.html.markdown b/website/docs/d/cloud_guard_security_recipes.html.markdown index 5aac54c19b3..d5d16632fcb 100644 --- a/website/docs/d/cloud_guard_security_recipes.html.markdown +++ b/website/docs/d/cloud_guard_security_recipes.html.markdown @@ -59,7 +59,6 @@ The following attributes are exported: * `owner` - The owner of the recipe * `security_policies` - The list of `SecurityPolicy` ids that are included in the recipe * `state` - The current state of the recipe -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the recipe was created. An RFC3339 formatted datetime string. * `time_updated` - The time the recipe was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/d/cloud_guard_security_zone.html.markdown b/website/docs/d/cloud_guard_security_zone.html.markdown index 82b4246f950..de77e6ca167 100644 --- a/website/docs/d/cloud_guard_security_zone.html.markdown +++ b/website/docs/d/cloud_guard_security_zone.html.markdown @@ -45,7 +45,6 @@ The following attributes are exported: * `security_zone_recipe_id` - The OCID of the recipe (`SecurityRecipe`) for the security zone * `security_zone_target_id` - The OCID of the target associated with the security zone * `state` - The current state of the security zone -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the security zone was created. An RFC3339 formatted datetime string. * `time_updated` - The time the security zone was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/d/cloud_guard_security_zones.html.markdown b/website/docs/d/cloud_guard_security_zones.html.markdown index 668139d6379..ffc40a5e021 100644 --- a/website/docs/d/cloud_guard_security_zones.html.markdown +++ b/website/docs/d/cloud_guard_security_zones.html.markdown @@ -64,7 +64,6 @@ The following attributes are exported: * `security_zone_recipe_id` - The OCID of the recipe (`SecurityRecipe`) for the security zone * `security_zone_target_id` - The OCID of the target associated with the security zone * `state` - The current state of the security zone -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the security zone was created. An RFC3339 formatted datetime string. * `time_updated` - The time the security zone was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/r/cloud_guard_security_recipe.html.markdown b/website/docs/r/cloud_guard_security_recipe.html.markdown index c7cba49ca68..0b355ff788b 100644 --- a/website/docs/r/cloud_guard_security_recipe.html.markdown +++ b/website/docs/r/cloud_guard_security_recipe.html.markdown @@ -62,7 +62,6 @@ The following attributes are exported: * `owner` - The owner of the recipe * `security_policies` - The list of `SecurityPolicy` ids that are included in the recipe * `state` - The current state of the recipe -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the recipe was created. An RFC3339 formatted datetime string. * `time_updated` - The time the recipe was last updated. An RFC3339 formatted datetime string. diff --git a/website/docs/r/cloud_guard_security_zone.html.markdown b/website/docs/r/cloud_guard_security_zone.html.markdown index 6b2fdf045f9..099eaae3dde 100644 --- a/website/docs/r/cloud_guard_security_zone.html.markdown +++ b/website/docs/r/cloud_guard_security_zone.html.markdown @@ -63,7 +63,6 @@ The following attributes are exported: * `security_zone_recipe_id` - The OCID of the recipe (`SecurityRecipe`) for the security zone * `security_zone_target_id` - The OCID of the target associated with the security zone * `state` - The current state of the security zone -* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The time the security zone was created. An RFC3339 formatted datetime string. * `time_updated` - The time the security zone was last updated. An RFC3339 formatted datetime string. From 487e156db2d50bedfaa727b5d9dd0ab32a3c66ad Mon Sep 17 00:00:00 2001 From: Terraform Team Automation Date: Fri, 19 May 2023 06:14:31 +0000 Subject: [PATCH 05/16] Added - Support for unified agent config CRI parser --- .../log_agent_configuration.tf | 21 ++- examples/logging/provider.tf | 2 +- ...ogging_unified_agent_configuration_test.go | 103 +++++++++++ ...ng_unified_agent_configuration_resource.go | 174 ++++++++++++++++++ website/docs/d/logging_log.html.markdown | 2 +- .../docs/d/logging_log_groups.html.markdown | 2 +- .../d/logging_log_saved_search.html.markdown | 4 +- .../logging_log_saved_searches.html.markdown | 6 +- website/docs/d/logging_logs.html.markdown | 8 +- ..._unified_agent_configuration.html.markdown | 52 +++--- ...unified_agent_configurations.html.markdown | 54 +++--- website/docs/r/logging_log.html.markdown | 4 +- ..._unified_agent_configuration.html.markdown | 112 ++++++----- 13 files changed, 444 insertions(+), 100 deletions(-) diff --git a/examples/logging/log_agent_configuration/log_agent_configuration.tf b/examples/logging/log_agent_configuration/log_agent_configuration.tf index 5b81ef963b4..2f0d6f680b7 100644 --- a/examples/logging/log_agent_configuration/log_agent_configuration.tf +++ b/examples/logging/log_agent_configuration/log_agent_configuration.tf @@ -12,7 +12,7 @@ variable "unified_agent_configuration_description" { } variable "unified_agent_configuration_display_name" { - default = "tf-agentConfigName" + default = "tf-agentConfigName1" } variable "unified_agent_configuration_freeform_tags" { @@ -196,6 +196,25 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura #Required source_type = var.unified_agent_configuration_service_configuration_sources_source_type + #Optional + # channels for windows only + # channels = var.unified_agent_configuration_service_configuration_sources_channels + name = var.unified_agent_configuration_service_configuration_sources_name + parser { + parser_type = "CRI" + is_merge_cri_fields = false + nested_parser { + time_format = "%Y-%m-%dT%H:%M:%S.%L%z" + field_time_key = "time" + is_keep_time_key = true + } + } + paths = ["/var/log/*"] + } + sources { + #Required + source_type = var.unified_agent_configuration_service_configuration_sources_source_type + #Optional # channels for windows only # channels = var.unified_agent_configuration_service_configuration_sources_channels diff --git a/examples/logging/provider.tf b/examples/logging/provider.tf index 087248f41e0..73941be7f19 100644 --- a/examples/logging/provider.tf +++ b/examples/logging/provider.tf @@ -31,6 +31,6 @@ provider "oci" { user_ocid = var.user_ocid fingerprint = var.fingerprint private_key_path = var.private_key_path -# version = "4.100.0" +# version = "4.119.0" } diff --git a/internal/integrationtest/logging_unified_agent_configuration_test.go b/internal/integrationtest/logging_unified_agent_configuration_test.go index 40fa7569651..aeb60145b66 100644 --- a/internal/integrationtest/logging_unified_agent_configuration_test.go +++ b/internal/integrationtest/logging_unified_agent_configuration_test.go @@ -104,6 +104,25 @@ var ( "parser": acctest.RepresentationGroup{RepType: acctest.Required, Group: LoggingUnifiedAgentConfigurationServiceConfigurationSourcesParserRepresentation}, //"channels": acctest.Representation{RepType: acctest.Required, Create: []string{`Security`}, Update: []string{`Security`, `Application`}}, } + + // Add new test configs here + // CRI parser configs + LoggingUnifiedAgentConfigurationServiceConfigurationSourcesCriParserNestedParserRepresentation = map[string]interface{}{ + "time_format": acctest.Representation{RepType: acctest.Optional, Create: `%Y-%m-%dT%H:%M:%S.%L%z`, Update: `%Y-%m-%d %H:%M:%S.%L%z`}, + "field_time_key": acctest.Representation{RepType: acctest.Optional, Create: `time`, Update: `time1`}, + "is_keep_time_key": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `false`}, + } + + LoggingUnifiedAgentConfigurationServiceConfigurationSourcesCriParserRepresentation = map[string]interface{}{ + "parser_type": acctest.Representation{RepType: acctest.Required, Create: `CRI`}, + "is_merge_cri_fields": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `false`}, + "nested_parser": acctest.RepresentationGroup{RepType: acctest.Optional, Group: LoggingUnifiedAgentConfigurationServiceConfigurationSourcesCriParserNestedParserRepresentation}, + } + + LoggingUnifiedAgentConfigurationCriRepresentation = acctest.GetUpdatedRepresentationCopy( + "service_configuration.sources.parser", + acctest.RepresentationGroup{RepType: acctest.Required, Group: LoggingUnifiedAgentConfigurationServiceConfigurationSourcesCriParserRepresentation}, + LoggingUnifiedAgentConfigurationRepresentation) ) // issue-routing-tag: logging/default @@ -129,6 +148,90 @@ func TestLoggingUnifiedAgentConfigurationResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_logging_unified_agent_configuration", "test_unified_agent_configuration", acctest.Optional, acctest.Create, LoggingUnifiedAgentConfigurationRepresentation), "logging", "unifiedAgentConfiguration", t) acctest.ResourceTest(t, testAccCheckLoggingUnifiedAgentConfigurationDestroy, []resource.TestStep{ + + // Add new tests here + // CRI parser test required + { + Config: config + compartmentIdVariableStr + LoggingUnifiedAgentConfigurationResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_logging_unified_agent_configuration", "test_unified_agent_configuration", acctest.Required, acctest.Create, LoggingUnifiedAgentConfigurationCriRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.configuration_type", "LOGGING"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.destination.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "service_configuration.0.destination.0.log_object_id"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.#", "1"), + //resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.channels.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.name", "name"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.paths.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.source_type", "LOG_TAIL"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.parser_type", "CRI"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // CRI parser test optional + { + Config: config + compartmentIdVariableStr + LoggingUnifiedAgentConfigurationResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_logging_unified_agent_configuration", "test_unified_agent_configuration", acctest.Optional, acctest.Create, LoggingUnifiedAgentConfigurationCriRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.configuration_type", "LOGGING"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.destination.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "service_configuration.0.destination.0.log_object_id"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.#", "1"), + //resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.channels.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.name", "name"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.paths.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.source_type", "LOG_TAIL"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.parser_type", "CRI"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.is_merge_cri_fields", "true"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.nested_parser.0.time_format", "%Y-%m-%dT%H:%M:%S.%L%z"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.nested_parser.0.field_time_key", "time"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.nested_parser.0.is_keep_time_key", "true"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // CRI parser test optional update + { + Config: config + compartmentIdVariableStr + LoggingUnifiedAgentConfigurationResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_logging_unified_agent_configuration", "test_unified_agent_configuration", acctest.Optional, acctest.Update, LoggingUnifiedAgentConfigurationCriRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.configuration_type", "LOGGING"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.destination.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "service_configuration.0.destination.0.log_object_id"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.#", "1"), + //resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.channels.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.name", "name"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.paths.#", "1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.source_type", "LOG_TAIL"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.parser_type", "CRI"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.is_merge_cri_fields", "false"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.nested_parser.0.time_format", "%Y-%m-%d %H:%M:%S.%L%z"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.nested_parser.0.field_time_key", "time1"), + resource.TestCheckResourceAttr(resourceName, "service_configuration.0.sources.0.parser.0.nested_parser.0.is_keep_time_key", "false"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // Don't change below tests // 0. verify Create { Config: config + compartmentIdVariableStr + LoggingUnifiedAgentConfigurationResourceDependencies + diff --git a/internal/service/logging/logging_unified_agent_configuration_resource.go b/internal/service/logging/logging_unified_agent_configuration_resource.go index 19d3bd64994..007b086b163 100644 --- a/internal/service/logging/logging_unified_agent_configuration_resource.go +++ b/internal/service/logging/logging_unified_agent_configuration_resource.go @@ -122,6 +122,7 @@ func LoggingUnifiedAgentConfigurationResource() *schema.Resource { "APACHE2", "APACHE_ERROR", "AUDITD", + "CRI", "CSV", "GROK", "JSON", @@ -184,6 +185,12 @@ func LoggingUnifiedAgentConfigurationResource() *schema.Resource { Optional: true, Computed: true, }, + "is_merge_cri_fields": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + DiffSuppressFunc: criDiffSuppressfunc, + }, "is_null_empty_string": { Type: schema.TypeBool, Optional: true, @@ -222,6 +229,40 @@ func LoggingUnifiedAgentConfigurationResource() *schema.Resource { Optional: true, Computed: true, }, + "nested_parser": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + // Optional + "field_time_key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "time_format": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "time_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "is_keep_time_key": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + }, + }, + DiffSuppressFunc: criDiffSuppressfunc, + }, "null_value_pattern": { Type: schema.TypeString, Optional: true, @@ -316,6 +357,8 @@ func LoggingUnifiedAgentConfigurationResource() *schema.Resource { }, }, + // Optional + // Computed }, }, @@ -1077,6 +1120,7 @@ func (s *LoggingUnifiedAgentConfigurationResourceCrud) mapToUnifiedAgentParser(f } else { parserType = "" // default value } + switch strings.ToLower(parserType) { case strings.ToLower("APACHE2"): details := oci_logging.UnifiedAgentApache2Parser{} @@ -1168,6 +1212,50 @@ func (s *LoggingUnifiedAgentConfigurationResourceCrud) mapToUnifiedAgentParser(f details.Types = tfresource.ObjectMapToStringMap(types.(map[string]interface{})) } baseObject = details + case strings.ToLower("CRI"): + details := oci_logging.UnifiedAgentCriParser{} + if isMergeCriFields, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_merge_cri_fields")); ok { + tmp := isMergeCriFields.(bool) + details.IsMergeCriFields = &tmp + } + if nestedParser, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "nested_parser")); ok { + if tmpList := nestedParser.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "nested_parser"), 0) + tmp, err := s.mapToUnifiedJsonParser(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert nested_parser, encountered error: %v", err) + } + details.NestedParser = &tmp + } + } + if fieldTimeKey, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "field_time_key")); ok { + tmp := fieldTimeKey.(string) + details.FieldTimeKey = &tmp + } + if isEstimateCurrentEvent, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_estimate_current_event")); ok { + tmp := isEstimateCurrentEvent.(bool) + details.IsEstimateCurrentEvent = &tmp + } + if isKeepTimeKey, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_keep_time_key")); ok { + tmp := isKeepTimeKey.(bool) + details.IsKeepTimeKey = &tmp + } + if isNullEmptyString, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_null_empty_string")); ok { + tmp := isNullEmptyString.(bool) + details.IsNullEmptyString = &tmp + } + if nullValuePattern, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "null_value_pattern")); ok { + tmp := nullValuePattern.(string) + details.NullValuePattern = &tmp + } + if timeoutInMilliseconds, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "timeout_in_milliseconds")); ok { + tmp := timeoutInMilliseconds.(int) + details.TimeoutInMilliseconds = &tmp + } + if types, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "types")); ok { + details.Types = tfresource.ObjectMapToStringMap(types.(map[string]interface{})) + } + baseObject = details case strings.ToLower("CSV"): details := oci_logging.UnifiedAgentCsvParser{} if delimiter, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "delimiter")); ok { @@ -1693,6 +1781,17 @@ func UnifiedAgentParserToMap(obj *oci_logging.UnifiedAgentParser) map[string]int if v.Types != nil { result["types"] = tfresource.StringMapToObjectMap(v.Types) } + case oci_logging.UnifiedAgentCriParser: + result["parser_type"] = "CRI" + + if v.IsMergeCriFields != nil { + result["is_merge_cri_fields"] = bool(*v.IsMergeCriFields) + } + + if v.NestedParser != nil { + result["nested_parser"] = []interface{}{UnifiedJsonParserToMap(v.NestedParser)} + } + case oci_logging.UnifiedAgentCsvParser: result["parser_type"] = "CSV" if v.FieldTimeKey != nil { @@ -2098,6 +2197,51 @@ func UnifiedAgentServiceConfigurationDetailsToMap(obj *oci_logging.UnifiedAgentS return result } +func (s *LoggingUnifiedAgentConfigurationResourceCrud) mapToUnifiedJsonParser(fieldKeyFormat string) (oci_logging.UnifiedJsonParser, error) { + result := oci_logging.UnifiedJsonParser{} + + if timeFormat, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "time_format")); ok { + tmp := timeFormat.(string) + result.TimeFormat = &tmp + } + + if timeType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "time_type")); ok { + result.TimeType = oci_logging.UnifiedJsonParserTimeTypeEnum(timeType.(string)) + } + + if fieldTimeKey, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "field_time_key")); ok { + tmp := fieldTimeKey.(string) + result.FieldTimeKey = &tmp + } + + if isKeepTimeKey, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_keep_time_key")); ok { + tmp := isKeepTimeKey.(bool) + result.IsKeepTimeKey = &tmp + } + + return result, nil +} + +func UnifiedJsonParserToMap(obj *oci_logging.UnifiedJsonParser) map[string]interface{} { + result := map[string]interface{}{} + + if obj.TimeFormat != nil { + result["time_format"] = string(*obj.TimeFormat) + } + + result["time_type"] = string(obj.TimeType) + + if obj.FieldTimeKey != nil { + result["field_time_key"] = *obj.FieldTimeKey + } + + if obj.IsKeepTimeKey != nil { + result["is_keep_time_key"] = *obj.IsKeepTimeKey + } + + return result +} + func (s *LoggingUnifiedAgentConfigurationResourceCrud) updateCompartment(compartment interface{}) error { changeCompartmentRequest := oci_logging.ChangeUnifiedAgentConfigurationCompartmentRequest{} @@ -2117,3 +2261,33 @@ func (s *LoggingUnifiedAgentConfigurationResourceCrud) updateCompartment(compart workId := response.OpcWorkRequestId return s.getUnifiedAgentConfigurationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "logging"), oci_logging.ActionTypesRelated, s.D.Timeout(schema.TimeoutUpdate)) } + +func criDiffSuppressfunc(k string, old string, new string, d *schema.ResourceData) bool { + // k = "service_configuration.0.sources.0.parser.0.xxx" + var parserTypeStr string + dotIndex := findNthDotIndex(k, 6) + if dotIndex != -1 { + parserTypePath := k[:dotIndex+1] + "parser_type" + if parserType, ok := d.GetOkExists(parserTypePath); ok { + parserTypeStr = parserType.(string) + if strings.ToLower(parserTypeStr) == "cri" { + return false + } + } + } + log.Printf("Diff suppress for parser_type: %v. k: %v, old: %v, new: %v", parserTypeStr, k, old, new) + return true +} + +func findNthDotIndex(s string, n int) int { + count := 0 + for i, char := range s { + if char == '.' { + count++ + if count == n { + return i + } + } + } + return -1 // Return -1 if the ith dot is not found +} diff --git a/website/docs/d/logging_log.html.markdown b/website/docs/d/logging_log.html.markdown index 89cf3836bf7..12211d684fe 100644 --- a/website/docs/d/logging_log.html.markdown +++ b/website/docs/d/logging_log.html.markdown @@ -51,7 +51,7 @@ The following attributes are exported: * `is_enabled` - Whether or not this resource is currently enabled. * `log_group_id` - Log group OCID. * `log_type` - The logType that the log object is for, whether custom or service. -* `retention_duration` - Log retention duration in 30-day increments (30, 60, 90 and so on). +* `retention_duration` - Log retention duration in 30-day increments (30, 60, 90 and so on until 180). * `state` - The pipeline state. * `tenancy_id` - The OCID of the tenancy. * `time_created` - Time the resource was created. diff --git a/website/docs/d/logging_log_groups.html.markdown b/website/docs/d/logging_log_groups.html.markdown index f7a4c5dd0b6..bae1b4dc908 100644 --- a/website/docs/d/logging_log_groups.html.markdown +++ b/website/docs/d/logging_log_groups.html.markdown @@ -30,7 +30,7 @@ data "oci_logging_log_groups" "test_log_groups" { The following arguments are supported: * `compartment_id` - (Required) Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal. -* `display_name` - (Optional) Resource name +* `display_name` - (Optional) Resource name. * `is_compartment_id_in_subtree` - (Optional) Specifies whether or not nested compartments should be traversed. Defaults to false. diff --git a/website/docs/d/logging_log_saved_search.html.markdown b/website/docs/d/logging_log_saved_search.html.markdown index ccdd5fb619b..18f6434751b 100644 --- a/website/docs/d/logging_log_saved_search.html.markdown +++ b/website/docs/d/logging_log_saved_search.html.markdown @@ -10,7 +10,7 @@ description: |- # Data Source: oci_logging_log_saved_search This data source provides details about a specific Log Saved Search resource in Oracle Cloud Infrastructure Logging service. -Retrieves a log saved search. +Retrieves a LogSavedSearch. ## Example Usage @@ -25,7 +25,7 @@ data "oci_logging_log_saved_search" "test_log_saved_search" { The following arguments are supported: -* `log_saved_search_id` - (Required) OCID of the logSavedSearch +* `log_saved_search_id` - (Required) OCID of the logSavedSearch. ## Attributes Reference diff --git a/website/docs/d/logging_log_saved_searches.html.markdown b/website/docs/d/logging_log_saved_searches.html.markdown index 322563d8d40..e7b975328cf 100644 --- a/website/docs/d/logging_log_saved_searches.html.markdown +++ b/website/docs/d/logging_log_saved_searches.html.markdown @@ -10,7 +10,7 @@ description: |- # Data Source: oci_logging_log_saved_searches This data source provides the list of Log Saved Searches in Oracle Cloud Infrastructure Logging service. -Lists Logging Saved Searches for this compartment. +Lists LogSavedSearches for this compartment. ## Example Usage @@ -31,8 +31,8 @@ data "oci_logging_log_saved_searches" "test_log_saved_searches" { The following arguments are supported: * `compartment_id` - (Required) Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal. -* `log_saved_search_id` - (Optional) OCID of the LogSavedSearch -* `name` - (Optional) Resource name +* `log_saved_search_id` - (Optional) OCID of the LogSavedSearch. +* `name` - (Optional) Resource name. ## Attributes Reference diff --git a/website/docs/d/logging_logs.html.markdown b/website/docs/d/logging_logs.html.markdown index cb03650840f..7c911de9b84 100644 --- a/website/docs/d/logging_logs.html.markdown +++ b/website/docs/d/logging_logs.html.markdown @@ -32,11 +32,11 @@ data "oci_logging_logs" "test_logs" { The following arguments are supported: -* `display_name` - (Optional) Resource name +* `display_name` - (Optional) Resource name. * `log_group_id` - (Required) OCID of a log group to work with. * `log_type` - (Optional) The logType that the log object is for, whether custom or service. -* `source_resource` - (Optional) Log object resource. -* `source_service` - (Optional) Service that created the log object. +* `source_resource` - (Optional) Log object resource, which is a field of LogSummary.Configuration.Source. +* `source_service` - (Optional) Service that created the log object, which is a field of LogSummary.Configuration.Source. * `state` - (Optional) Lifecycle state of the log object @@ -66,7 +66,7 @@ The following attributes are exported: * `is_enabled` - Whether or not this resource is currently enabled. * `log_group_id` - Log group OCID. * `log_type` - The logType that the log object is for, whether custom or service. -* `retention_duration` - Log retention duration in 30-day increments (30, 60, 90 and so on). +* `retention_duration` - Log retention duration in 30-day increments (30, 60, 90 and so on until 180). * `state` - The pipeline state. * `tenancy_id` - The OCID of the tenancy. * `time_created` - Time the resource was created. diff --git a/website/docs/d/logging_unified_agent_configuration.html.markdown b/website/docs/d/logging_unified_agent_configuration.html.markdown index a4a053b4a0c..6a4a067f3ef 100644 --- a/website/docs/d/logging_unified_agent_configuration.html.markdown +++ b/website/docs/d/logging_unified_agent_configuration.html.markdown @@ -46,41 +46,51 @@ The following attributes are exported: * `configuration_type` - Type of Unified Agent service configuration. * `destination` - Logging destination object. * `log_object_id` - The OCID of the resource. - * `sources` - - * `channels` - + * `sources` - Logging source object. + * `channels` - Windows event log channels. * `name` - unique name for the source * `parser` - source parser object. - * `delimiter` - - * `expression` - + * `delimiter` - csv delimiter. + * `expression` - Regex pattern. * `field_time_key` - Specify time field for the event time. If the event doesn't have this field, the current time is used. - * `format` - - * `format_firstline` - - * `grok_failure_key` - - * `grok_name_key` - + * `format` - Mutiline pattern format. + * `format_firstline` - First line pattern format. + * `grok_failure_key` - grok failure key. + * `grok_name_key` - grok name key. * `is_estimate_current_event` - If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. * `is_keep_time_key` - If true, keep time field in the record. + * `is_merge_cri_fields` - If you don't need stream/logtag fields, set this to false for CRI parser. * `is_null_empty_string` - If true, an empty string field is replaced with nil. - * `is_support_colonless_ident` - - * `is_with_priority` - - * `keys` - - * `message_format` - - * `message_key` - - * `multi_line_start_regexp` - + * `is_support_colonless_ident` - Support colonless ident or not. + * `is_with_priority` - With priority or not. + * `keys` - csv keys. + * `message_format` - Message format of syslog. + * `message_key` - Specifies the field name to contain logs. + * `multi_line_start_regexp` - Multiline start regexp pattern. + * `nested_parser` - Optional nested JSON Parser for CRI Parser. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. + * `time_format` - Process time value using the specified format. + * `time_type` - Time type of JSON parser. * `null_value_pattern` - Specify the null value pattern. * `parser_type` - Type of fluent parser. - * `patterns` - + * `patterns` - grok pattern object. * `field_time_format` - Process value using the specified format. This is available only when time_type is a string. * `field_time_key` - Specify the time field for the event time. If the event doesn't have this field, the current time is used. * `field_time_zone` - Use the specified time zone. The time value can be parsed or formatted in the specified time zone. * `name` - The name key to tag this grok pattern. * `pattern` - The grok pattern. - * `rfc5424time_format` - - * `syslog_parser_type` - - * `time_format` - - * `time_type` - + * `rfc5424time_format` - rfc5424 time format. + * `syslog_parser_type` - Syslog parser type. + * `time_format` - Process time value using the specified format. + * `time_type` - Time type of JSON parser. * `timeout_in_milliseconds` - Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. - * `types` - Specify types for converting a field into another type. - * `paths` - + * `types` - Specify types for converting a field into another type. For example, With this configuration: @type csv keys time,host,req_id,user time_key time + + This incoming event: "2013/02/28 12:00:00,192.168.0.1,111,-" + + is parsed as: 1362020400 (2013/02/28/ 12:00:00) + + record: { "host" : "192.168.0.1", "req_id" : "111", "user" : "-" } + * `paths` - Absolute paths for log source files. Wildcard can be used. * `source_type` - Unified schema logging source type. * `state` - The pipeline state. * `time_created` - Time the resource was created. diff --git a/website/docs/d/logging_unified_agent_configurations.html.markdown b/website/docs/d/logging_unified_agent_configurations.html.markdown index 68cfbfaedea..b2e8e2095be 100644 --- a/website/docs/d/logging_unified_agent_configurations.html.markdown +++ b/website/docs/d/logging_unified_agent_configurations.html.markdown @@ -33,7 +33,7 @@ data "oci_logging_unified_agent_configurations" "test_unified_agent_configuratio The following arguments are supported: * `compartment_id` - (Required) Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal. -* `display_name` - (Optional) Resource name +* `display_name` - (Optional) Resource name. * `group_id` - (Optional) The OCID of a group or a dynamic group. * `is_compartment_id_in_subtree` - (Optional) Specifies whether or not nested compartments should be traversed. Defaults to false. * `log_id` - (Optional) Custom log OCID to list resources with the log as destination. @@ -64,41 +64,51 @@ The following attributes are exported: * `configuration_type` - Type of Unified Agent service configuration. * `destination` - Logging destination object. * `log_object_id` - The OCID of the resource. - * `sources` - - * `channels` - + * `sources` - Logging source object. + * `channels` - Windows event log channels. * `name` - unique name for the source * `parser` - source parser object. - * `delimiter` - - * `expression` - + * `delimiter` - csv delimiter. + * `expression` - Regex pattern. * `field_time_key` - Specify time field for the event time. If the event doesn't have this field, the current time is used. - * `format` - - * `format_firstline` - - * `grok_failure_key` - - * `grok_name_key` - + * `format` - Mutiline pattern format. + * `format_firstline` - First line pattern format. + * `grok_failure_key` - grok failure key. + * `grok_name_key` - grok name key. * `is_estimate_current_event` - If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. * `is_keep_time_key` - If true, keep time field in the record. + * `is_merge_cri_fields` - If you don't need stream/logtag fields, set this to false for CRI parser. * `is_null_empty_string` - If true, an empty string field is replaced with nil. - * `is_support_colonless_ident` - - * `is_with_priority` - - * `keys` - - * `message_format` - - * `message_key` - - * `multi_line_start_regexp` - + * `is_support_colonless_ident` - Support colonless ident or not. + * `is_with_priority` - With priority or not. + * `keys` - csv keys. + * `message_format` - Message format of syslog. + * `message_key` - Specifies the field name to contain logs. + * `multi_line_start_regexp` - Multiline start regexp pattern. + * `nested_parser` - Optional nested JSON Parser for CRI Parser. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. + * `time_format` - Process time value using the specified format. + * `time_type` - Time type of JSON parser. * `null_value_pattern` - Specify the null value pattern. * `parser_type` - Type of fluent parser. - * `patterns` - + * `patterns` - grok pattern object. * `field_time_format` - Process value using the specified format. This is available only when time_type is a string. * `field_time_key` - Specify the time field for the event time. If the event doesn't have this field, the current time is used. * `field_time_zone` - Use the specified time zone. The time value can be parsed or formatted in the specified time zone. * `name` - The name key to tag this grok pattern. * `pattern` - The grok pattern. - * `rfc5424time_format` - - * `syslog_parser_type` - - * `time_format` - - * `time_type` - + * `rfc5424time_format` - rfc5424 time format. + * `syslog_parser_type` - Syslog parser type. + * `time_format` - Process time value using the specified format. + * `time_type` - Time type of JSON parser. * `timeout_in_milliseconds` - Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. - * `types` - Specify types for converting a field into another type. - * `paths` - + * `types` - Specify types for converting a field into another type. For example, With this configuration: @type csv keys time,host,req_id,user time_key time + + This incoming event: "2013/02/28 12:00:00,192.168.0.1,111,-" + + is parsed as: 1362020400 (2013/02/28/ 12:00:00) + + record: { "host" : "192.168.0.1", "req_id" : "111", "user" : "-" } + * `paths` - Absolute paths for log source files. Wildcard can be used. * `source_type` - Unified schema logging source type. * `state` - The pipeline state. * `time_created` - Time the resource was created. diff --git a/website/docs/r/logging_log.html.markdown b/website/docs/r/logging_log.html.markdown index 7bd54464306..95c417ea339 100644 --- a/website/docs/r/logging_log.html.markdown +++ b/website/docs/r/logging_log.html.markdown @@ -62,7 +62,7 @@ The following arguments are supported: * `is_enabled` - (Optional) (Updatable) Whether or not this resource is currently enabled. * `log_group_id` - (Required) (Updatable) OCID of a log group to work with. * `log_type` - (Required) The logType that the log object is for, whether custom or service. -* `retention_duration` - (Optional) (Updatable) Log retention duration in 30-day increments (30, 60, 90 and so on). +* `retention_duration` - (Optional) (Updatable) Log retention duration in 30-day increments (30, 60, 90 and so on until 180). ** IMPORTANT ** @@ -88,7 +88,7 @@ The following attributes are exported: * `is_enabled` - Whether or not this resource is currently enabled. * `log_group_id` - Log group OCID. * `log_type` - The logType that the log object is for, whether custom or service. -* `retention_duration` - Log retention duration in 30-day increments (30, 60, 90 and so on). +* `retention_duration` - Log retention duration in 30-day increments (30, 60, 90 and so on until 180). * `state` - The pipeline state. * `tenancy_id` - The OCID of the tenancy. * `time_created` - Time the resource was created. diff --git a/website/docs/r/logging_unified_agent_configuration.html.markdown b/website/docs/r/logging_unified_agent_configuration.html.markdown index 5083c579457..2ac8a3f7c91 100644 --- a/website/docs/r/logging_unified_agent_configuration.html.markdown +++ b/website/docs/r/logging_unified_agent_configuration.html.markdown @@ -50,6 +50,7 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura grok_name_key = var.unified_agent_configuration_service_configuration_sources_parser_grok_name_key is_estimate_current_event = var.unified_agent_configuration_service_configuration_sources_parser_is_estimate_current_event is_keep_time_key = var.unified_agent_configuration_service_configuration_sources_parser_is_keep_time_key + is_merge_cri_fields = var.unified_agent_configuration_service_configuration_sources_parser_is_merge_cri_fields is_null_empty_string = var.unified_agent_configuration_service_configuration_sources_parser_is_null_empty_string is_support_colonless_ident = var.unified_agent_configuration_service_configuration_sources_parser_is_support_colonless_ident is_with_priority = var.unified_agent_configuration_service_configuration_sources_parser_is_with_priority @@ -57,6 +58,13 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura message_format = var.unified_agent_configuration_service_configuration_sources_parser_message_format message_key = var.unified_agent_configuration_service_configuration_sources_parser_message_key multi_line_start_regexp = var.unified_agent_configuration_service_configuration_sources_parser_multi_line_start_regexp + nested_parser { + + #Optional + time_format = var.unified_agent_configuration_service_configuration_sources_parser_nested_parser_time_format + field_time_key = var.unified_agent_configuration_service_configuration_sources_parser_nested_parser_field_time_key + is_keep_time_key = var.unified_agent_configuration_service_configuration_sources_parser_nested_parser_is_keep_time_key + } null_value_pattern = var.unified_agent_configuration_service_configuration_sources_parser_null_value_pattern patterns { @@ -105,41 +113,51 @@ The following arguments are supported: * `configuration_type` - (Required) (Updatable) Type of Unified Agent service configuration. * `destination` - (Required) (Updatable) Logging destination object. * `log_object_id` - (Required) (Updatable) The OCID of the resource. - * `sources` - (Required) (Updatable) - * `channels` - (Applicable when source_type=WINDOWS_EVENT_LOG) (Updatable) + * `sources` - (Required) (Updatable) Logging source object. + * `channels` - (Required when source_type=WINDOWS_EVENT_LOG) (Updatable) Windows event log channels. * `name` - (Required when configuration_type=LOGGING) (Updatable) unique name for the source * `parser` - (Applicable when source_type=LOG_TAIL) (Updatable) source parser object. - * `delimiter` - (Applicable when parser_type=CSV | TSV) (Updatable) - * `expression` - (Applicable when parser_type=REGEXP) (Updatable) + * `delimiter` - (Applicable when parser_type=CSV | TSV) (Updatable) csv delimiter. + * `expression` - (Required when parser_type=REGEXP) (Updatable) Regex pattern. * `field_time_key` - (Applicable when source_type=LOG_TAIL) (Updatable) Specify time field for the event time. If the event doesn't have this field, the current time is used. - * `format` - (Applicable when parser_type=MULTILINE) (Updatable) - * `format_firstline` - (Applicable when parser_type=MULTILINE) (Updatable) - * `grok_failure_key` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) - * `grok_name_key` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) + * `format` - (Required when parser_type=MULTILINE) (Updatable) Mutiline pattern format. + * `format_firstline` - (Applicable when parser_type=MULTILINE) (Updatable) First line pattern format. + * `grok_failure_key` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) grok failure key. + * `grok_name_key` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) grok name key. * `is_estimate_current_event` - (Applicable when source_type=LOG_TAIL) (Updatable) If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. * `is_keep_time_key` - (Applicable when source_type=LOG_TAIL) (Updatable) If true, keep time field in the record. + * `is_merge_cri_fields` - (Applicable when parser_type=CRI) (Updatable) If you don't need stream/logtag fields, set this to false. * `is_null_empty_string` - (Applicable when source_type=LOG_TAIL) (Updatable) If true, an empty string field is replaced with nil. - * `is_support_colonless_ident` - (Applicable when parser_type=SYSLOG) (Updatable) - * `is_with_priority` - (Applicable when parser_type=SYSLOG) (Updatable) - * `keys` - (Applicable when parser_type=CSV | TSV) (Updatable) - * `message_format` - (Applicable when parser_type=SYSLOG) (Updatable) - * `message_key` - (Applicable when parser_type=NONE) (Updatable) - * `multi_line_start_regexp` - (Applicable when parser_type=MULTILINE_GROK) (Updatable) + * `is_support_colonless_ident` - (Applicable when parser_type=SYSLOG) (Updatable) Support colonless ident or not. + * `is_with_priority` - (Applicable when parser_type=SYSLOG) (Updatable) With priority or not. + * `keys` - (Required when parser_type=CSV | TSV) (Updatable) csv keys. + * `message_format` - (Applicable when parser_type=SYSLOG) (Updatable) Message format of syslog. + * `message_key` - (Applicable when parser_type=NONE) (Updatable) Specifies the field name to contain logs. + * `multi_line_start_regexp` - (Applicable when parser_type=MULTILINE_GROK) (Updatable) Multiline start regexp pattern. + * `nested_parser` - (Applicable when parser_type=CRI) (Updatable) Optional nested JSON Parser for CRI Parser. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. + * `time_format` - (Applicable when parser_type=CRI) (Updatable) Process time value using the specified format. + * `time_type` - (Applicable when parser_type=CRI) (Updatable) Time type of JSON parser. * `null_value_pattern` - (Applicable when source_type=LOG_TAIL) (Updatable) Specify the null value pattern. * `parser_type` - (Required) (Updatable) Type of fluent parser. - * `patterns` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) + * `patterns` - (Required when parser_type=GROK | MULTILINE_GROK) (Updatable) grok pattern object. * `field_time_format` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) Process value using the specified format. This is available only when time_type is a string. * `field_time_key` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) Specify the time field for the event time. If the event doesn't have this field, the current time is used. * `field_time_zone` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) Use the specified time zone. The time value can be parsed or formatted in the specified time zone. * `name` - (Applicable when parser_type=GROK | MULTILINE_GROK) (Updatable) The name key to tag this grok pattern. * `pattern` - (Required when parser_type=GROK | MULTILINE_GROK) (Updatable) The grok pattern. - * `rfc5424time_format` - (Applicable when parser_type=SYSLOG) (Updatable) - * `syslog_parser_type` - (Applicable when parser_type=SYSLOG) (Updatable) - * `time_format` - (Applicable when parser_type=JSON | REGEXP | SYSLOG) (Updatable) - * `time_type` - (Applicable when parser_type=JSON) (Updatable) + * `rfc5424time_format` - (Applicable when parser_type=SYSLOG) (Updatable) rfc5424 time format. + * `syslog_parser_type` - (Applicable when parser_type=SYSLOG) (Updatable) Syslog parser type. + * `time_format` - (Applicable when parser_type=JSON | REGEXP | SYSLOG) (Updatable) Process time value using the specified format. + * `time_type` - (Applicable when parser_type=JSON) (Updatable) Time type of JSON parser. * `timeout_in_milliseconds` - (Applicable when source_type=LOG_TAIL) (Updatable) Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. - * `types` - (Applicable when source_type=LOG_TAIL) (Updatable) Specify types for converting a field into another type. - * `paths` - (Applicable when source_type=LOG_TAIL) (Updatable) + * `types` - (Applicable when source_type=LOG_TAIL) (Updatable) Specify types for converting a field into another type. For example, With this configuration: @type csv keys time,host,req_id,user time_key time + + This incoming event: "2013/02/28 12:00:00,192.168.0.1,111,-" + + is parsed as: 1362020400 (2013/02/28/ 12:00:00) + + record: { "host" : "192.168.0.1", "req_id" : "111", "user" : "-" } + * `paths` - (Required when source_type=LOG_TAIL) (Updatable) Absolute paths for log source files. Wildcard can be used. * `source_type` - (Required) (Updatable) Unified schema logging source type. @@ -164,41 +182,51 @@ The following attributes are exported: * `configuration_type` - Type of Unified Agent service configuration. * `destination` - Logging destination object. * `log_object_id` - The OCID of the resource. - * `sources` - - * `channels` - + * `sources` - Logging source object. + * `channels` - Windows event log channels. * `name` - unique name for the source * `parser` - source parser object. - * `delimiter` - - * `expression` - + * `delimiter` - csv delimiter. + * `expression` - Regex pattern. * `field_time_key` - Specify time field for the event time. If the event doesn't have this field, the current time is used. - * `format` - - * `format_firstline` - - * `grok_failure_key` - - * `grok_name_key` - + * `format` - Mutiline pattern format. + * `format_firstline` - First line pattern format. + * `grok_failure_key` - grok failure key. + * `grok_name_key` - grok name key. * `is_estimate_current_event` - If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. * `is_keep_time_key` - If true, keep time field in the record. + * `is_merge_cri_fields` - If you don't need stream/logtag fields, set this to false for CRI parser. * `is_null_empty_string` - If true, an empty string field is replaced with nil. - * `is_support_colonless_ident` - - * `is_with_priority` - - * `keys` - - * `message_format` - - * `message_key` - - * `multi_line_start_regexp` - + * `is_support_colonless_ident` - Support colonless ident or not. + * `is_with_priority` - With priority or not. + * `keys` - csv keys. + * `message_format` - Message format of syslog. + * `message_key` - Specifies the field name to contain logs. + * `multi_line_start_regexp` - Multiline start regexp pattern. + * `nested_parser` - Optional nested JSON Parser for CRI Parser. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. + * `time_format` - Process time value using the specified format. + * `time_type` - Time type of JSON parser. * `null_value_pattern` - Specify the null value pattern. * `parser_type` - Type of fluent parser. - * `patterns` - + * `patterns` - grok pattern object. * `field_time_format` - Process value using the specified format. This is available only when time_type is a string. * `field_time_key` - Specify the time field for the event time. If the event doesn't have this field, the current time is used. * `field_time_zone` - Use the specified time zone. The time value can be parsed or formatted in the specified time zone. * `name` - The name key to tag this grok pattern. * `pattern` - The grok pattern. - * `rfc5424time_format` - - * `syslog_parser_type` - - * `time_format` - - * `time_type` - + * `rfc5424time_format` - rfc5424 time format. + * `syslog_parser_type` - Syslog parser type. + * `time_format` - Process time value using the specified format. + * `time_type` - Time type of JSON parser. * `timeout_in_milliseconds` - Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. - * `types` - Specify types for converting a field into another type. - * `paths` - + * `types` - Specify types for converting a field into another type. For example, With this configuration: @type csv keys time,host,req_id,user time_key time + + This incoming event: "2013/02/28 12:00:00,192.168.0.1,111,-" + + is parsed as: 1362020400 (2013/02/28/ 12:00:00) + + record: { "host" : "192.168.0.1", "req_id" : "111", "user" : "-" } + * `paths` - Absolute paths for log source files. Wildcard can be used. * `source_type` - Unified schema logging source type. * `state` - The pipeline state. * `time_created` - Time the resource was created. From 5636cc1bfe3d9d3d61e320dc9f3e5fbc05c9d5e7 Mon Sep 17 00:00:00 2001 From: Terraform Team Automation Date: Fri, 19 May 2023 06:38:19 +0000 Subject: [PATCH 06/16] Added - Support for DNS Secondary Egress and creating DNS zones from zone files --- examples/dns/global/zone.tf | 22 +- examples/dns/zone_file/provider.tf | 33 ++ examples/dns/zone_file/zone.tf | 40 ++ ..._action_create_zone_from_zone_file_test.go | 85 ++++ .../integrationtest/dns_zone_resource_test.go | 54 ++- internal/integrationtest/dns_zone_test.go | 34 +- ...ion_create_zone_from_zone_file_resource.go | 380 ++++++++++++++++++ internal/service/dns/dns_zone_resource.go | 170 +++++++- internal/service/dns/register_resource.go | 1 + website/docs/d/dns_zones.html.markdown | 8 + ...n_create_zone_from_zone_file.html.markdown | 100 +++++ website/docs/r/dns_zone.html.markdown | 35 +- 12 files changed, 904 insertions(+), 58 deletions(-) create mode 100644 examples/dns/zone_file/provider.tf create mode 100644 examples/dns/zone_file/zone.tf create mode 100644 internal/integrationtest/dns_action_create_zone_from_zone_file_test.go create mode 100644 internal/service/dns/dns_action_create_zone_from_zone_file_resource.go create mode 100644 website/docs/r/dns_action_create_zone_from_zone_file.html.markdown diff --git a/examples/dns/global/zone.tf b/examples/dns/global/zone.tf index 777dc27a2d8..7e9feb4123e 100644 --- a/examples/dns/global/zone.tf +++ b/examples/dns/global/zone.tf @@ -17,35 +17,35 @@ resource "oci_dns_zone" "zone1" { zone_type = "PRIMARY" } -resource "oci_dns_zone" "zone3" { - compartment_id = var.compartment_ocid - name = "${data.oci_identity_tenancy.tenancy.name}-${random_string.random_prefix.result}-tf-example3-primary.oci-dns1" - zone_type = "PRIMARY" -} - resource "oci_dns_tsig_key" "test_tsig_key" { algorithm = "hmac-sha1" compartment_id = var.compartment_ocid - name = "${random_string.random_prefix.result}-test_tsig_key-name" + name = "${random_string.random_prefix.result}-test-tsig-key-name" secret = "c2VjcmV0" } resource "oci_dns_zone" "zone2" { compartment_id = var.compartment_ocid - name = "${data.oci_identity_tenancy.tenancy.name}-${random_string.random_prefix.result}-tf-example-secondary.oci-dns2" - zone_type = "SECONDARY" + name = "${data.oci_identity_tenancy.tenancy.name}-${random_string.random_prefix.result}-tf-example2-primary.oci-dns2" + zone_type = "PRIMARY" - external_masters { + external_downstreams { address = "77.64.12.1" tsig_key_id = oci_dns_tsig_key.test_tsig_key.id } - external_masters { + external_downstreams { address = "77.64.12.2" tsig_key_id = oci_dns_tsig_key.test_tsig_key.id } } +resource "oci_dns_zone" "zone3" { + compartment_id = var.compartment_ocid + name = "${data.oci_identity_tenancy.tenancy.name}-${random_string.random_prefix.result}-tf-example3-primary.oci-dns1" + zone_type = "PRIMARY" +} + data "oci_dns_zones" "zs" { compartment_id = var.compartment_ocid name_contains = "example" diff --git a/examples/dns/zone_file/provider.tf b/examples/dns/zone_file/provider.tf new file mode 100644 index 00000000000..bb3802a42bc --- /dev/null +++ b/examples/dns/zone_file/provider.tf @@ -0,0 +1,33 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +/* + * Provider config for dns sample + */ + +variable "tenancy_ocid" { +} + +variable "user_ocid" { +} + +variable "fingerprint" { +} + +variable "private_key_path" { +} + +variable "compartment_ocid" { +} + +variable "region" { +} + +provider "oci" { + region = var.region + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path +} + diff --git a/examples/dns/zone_file/zone.tf b/examples/dns/zone_file/zone.tf new file mode 100644 index 00000000000..fd63182499d --- /dev/null +++ b/examples/dns/zone_file/zone.tf @@ -0,0 +1,40 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +/* + * This file demonstrates creating a zone from a zone file using terraform. + */ + +/* + * Step 1: Create the zone from the zone file. + * Run Terraform plan/apply and wait until the zone has been created. Note the OCID of the zone. + * Step 2: Uncomment the oci_dns_zone below, and comment out the oci_dns_action_create_zone_from_zone_file + Run `terraform import oci_dns_zone.zone ZONE_OCID`, replacing ZONE_OCID with the OCID of the zone from step 1. + * Step 3: Run Terraform plan/apply. + Terraform will show that it is deleting the oci_dns_action_create_zone_from_zone_file resource, but the zone will not be deleted. The zone is now fully managed by the oci_dns_zone resource. + */ + +resource "random_string" "random_prefix" { + length = 4 + number = false + special = false +} + +data "oci_identity_tenancy" "tenancy" { + tenancy_id = var.tenancy_ocid +} + +locals { + zone_name = "${data.oci_identity_tenancy.tenancy.name}-${random_string.random_prefix.result}-tf-example-primary.oci-dns1" +} + +resource "oci_dns_action_create_zone_from_zone_file" "zonefile" { + compartment_id = var.compartment_ocid + create_zone_from_zone_file_details = "$ORIGIN ${local.zone_name}.\n$TTL 3600\n${local.zone_name}. IN SOA ns1.${local.zone_name}. admin.${local.zone_name}. ( 1 7200 3600 14400 3600)\n${local.zone_name}. IN NS ns1.${local.zone_name}." +} + +#resource "oci_dns_zone" "zone" { +# name = local.zone_name +# compartment_id = var.compartment_ocid +# zone_type = "PRIMARY" +#} diff --git a/internal/integrationtest/dns_action_create_zone_from_zone_file_test.go b/internal/integrationtest/dns_action_create_zone_from_zone_file_test.go new file mode 100644 index 00000000000..b81157e75b5 --- /dev/null +++ b/internal/integrationtest/dns_action_create_zone_from_zone_file_test.go @@ -0,0 +1,85 @@ +// Copyright (c) 2017, 2021, 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 ( + DnsActionCreateZoneFromZoneFileRequiredOnlyResource = acctest.GenerateResourceFromRepresentationMap("oci_dns_action_create_zone_from_zone_file", "test_action_create_zone_from_zone_file", acctest.Required, acctest.Create, DnsActionCreateZoneFromZoneFileRepresentation) + + DnsActionCreateZoneFromZoneFileRepresentation = map[string]interface{}{ + "create_zone_from_zone_file_details": acctest.Representation{RepType: acctest.Required, Create: `createZoneFromZoneFileDetails`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "scope": acctest.Representation{RepType: acctest.Optional, Create: `GLOBAL`}, + } +) + +// issue-routing-tag: dns/default +func TestDnsActionCreateZoneFromZoneFileResource_basic(t *testing.T) { + t.Skip("This test will not work as the oci_dns_action_create_zone_from_zone_file must be imported to a oci_dns_zone resource to manage the zone beyond creation") + httpreplay.SetScenario("TestDnsActionCreateZoneFromZoneFileResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_dns_action_create_zone_from_zone_file.test_action_create_zone_from_zone_file" + + 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+ + acctest.GenerateResourceFromRepresentationMap("oci_dns_action_create_zone_from_zone_file", "test_action_create_zone_from_zone_file", acctest.Optional, acctest.Create, DnsActionCreateZoneFromZoneFileRepresentation), "dns", "actionCreateZoneFromZoneFile", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_dns_action_create_zone_from_zone_file", "test_action_create_zone_from_zone_file", acctest.Required, acctest.Create, DnsActionCreateZoneFromZoneFileRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "create_zone_from_zone_file_details", "createZoneFromZoneFileDetails"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_dns_action_create_zone_from_zone_file", "test_action_create_zone_from_zone_file", acctest.Optional, acctest.Create, DnsActionCreateZoneFromZoneFileRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "create_zone_from_zone_file_details", "createZoneFromZoneFileDetails"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "scope", "GLOBAL"), + + 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 + }, + ), + }, + }) +} diff --git a/internal/integrationtest/dns_zone_resource_test.go b/internal/integrationtest/dns_zone_resource_test.go index 0be8b3a285e..f03c5960be5 100644 --- a/internal/integrationtest/dns_zone_resource_test.go +++ b/internal/integrationtest/dns_zone_resource_test.go @@ -48,16 +48,22 @@ var ( }) zoneRepresentationPrimaryDefault = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "name": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_tenancy.test_tenancy.name}.{{.token}}.oci-zone-test`}, - "zone_type": acctest.Representation{RepType: acctest.Required, Create: `PRIMARY`}, - "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")}`}, - "external_masters": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DnsZoneExternalMastersRepresentation}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags2": "freeformTags2"}}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "name": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_tenancy.test_tenancy.name}.{{.token}}.oci-zone-test`}, + "zone_type": acctest.Representation{RepType: acctest.Required, Create: `PRIMARY`}, + "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")}`}, + "external_downstreams": acctest.RepresentationGroup{RepType: acctest.Optional, Group: zoneExternalDownstreamsRepresentation}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags2": "freeformTags2"}}, } zoneRepresentationDefault = acctest.GetUpdatedRepresentationCopy("zone_type", acctest.Representation{RepType: acctest.Required, Create: `SECONDARY`}, zoneRepresentationPrimaryDefault) + zoneExternalDownstreamsRepresentation = map[string]interface{}{ + "address": acctest.Representation{RepType: acctest.Required, Create: `1.2.3.4`, Update: `2.3.4.5`}, + "port": acctest.Representation{RepType: acctest.Optional, Create: `53`}, + "tsig_key_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_dns_tsig_key.test_tsig_key.id}`}, + } + ZoneResourceDependenciesDefault = acctest.GenerateResourceFromRepresentationMap("oci_dns_tsig_key", "test_tsig_key", acctest.Required, acctest.Create, DnsTsigKeyRepresentation) + DefinedTagsDependencies + ` data "oci_identity_tenancy" "test_tenancy" { @@ -103,15 +109,15 @@ func TestDnsZoneResource_default(t *testing.T) { }, { Config: tokenFn(config+compartmentIdVariableStr+ZoneResourceDependenciesDefault+ - acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, zoneRepresentationDefault), nil), + acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, zoneRepresentationPrimaryDefault), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(resourceName, "external_masters.#", "1"), - resource.TestCheckResourceAttr(resourceName, "external_masters.0.address", "77.64.12.1"), - resource.TestCheckResourceAttr(resourceName, "external_masters.0.port", "53"), - resource.TestCheckResourceAttrSet(resourceName, "external_masters.0.tsig_key_id"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.#", "1"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.address", "1.2.3.4"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.port", "53"), + resource.TestCheckResourceAttrSet(resourceName, "external_downstreams.0.tsig_key_id"), resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("\\.oci-zone-test")), - resource.TestCheckResourceAttr(resourceName, "zone_type", "SECONDARY"), + resource.TestCheckResourceAttr(resourceName, "zone_type", "PRIMARY"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -131,10 +137,13 @@ func TestDnsZoneResource_default(t *testing.T) { // verify Create with optionals { Config: tokenFn(config+compartmentIdVariableStr+ZoneResourceDependenciesDefault+ - acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, - acctest.RepresentationCopyWithRemovedProperties(zoneRepresentationPrimaryDefault, []string{"external_masters"})), nil), + acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, zoneRepresentationPrimaryDefault), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.#", "1"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.address", "1.2.3.4"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.port", "53"), + resource.TestCheckResourceAttrSet(resourceName, "external_downstreams.0.tsig_key_id"), resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("\\.oci-zone-test")), resource.TestCheckResourceAttr(resourceName, "zone_type", "PRIMARY"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), @@ -163,11 +172,15 @@ func TestDnsZoneResource_default(t *testing.T) { { Config: tokenFn(config+compartmentIdVariableStr+compartmentIdUVariableStr+ZoneResourceDependenciesDefault+ acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, - acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(zoneRepresentationPrimaryDefault, []string{"external_masters"}), map[string]interface{}{ + acctest.RepresentationCopyWithNewProperties(zoneRepresentationPrimaryDefault, map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, })), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.#", "1"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.address", "1.2.3.4"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.port", "53"), + resource.TestCheckResourceAttrSet(resourceName, "external_downstreams.0.tsig_key_id"), resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("\\.oci-zone-test")), resource.TestCheckResourceAttr(resourceName, "zone_type", "PRIMARY"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), @@ -194,10 +207,13 @@ func TestDnsZoneResource_default(t *testing.T) { // verify updates to updatable parameters { Config: tokenFn(config+compartmentIdVariableStr+ZoneResourceDependenciesDefault+ - acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Update, - acctest.RepresentationCopyWithRemovedProperties(zoneRepresentationPrimaryDefault, []string{"external_masters"})), nil), + acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Update, zoneRepresentationPrimaryDefault), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.#", "1"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.address", "2.3.4.5"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.port", "53"), + resource.TestCheckResourceAttrSet(resourceName, "external_downstreams.0.tsig_key_id"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "zone_type", "PRIMARY"), resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("\\.oci-zone-test")), @@ -227,6 +243,10 @@ func TestDnsZoneResource_default(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Required, acctest.Create, zoneRepresentationPrimaryDefault), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.#", "1"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.address", "2.3.4.5"), + resource.TestCheckResourceAttr(resourceName, "external_downstreams.0.port", "53"), + resource.TestCheckResourceAttrSet(resourceName, "external_downstreams.0.tsig_key_id"), resource.TestCheckResourceAttr(datasourceName, "zones.#", "1"), resource.TestCheckResourceAttr(datasourceName, "zones.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "zones.0.id"), diff --git a/internal/integrationtest/dns_zone_test.go b/internal/integrationtest/dns_zone_test.go index 455dd8a8194..1c423b8e863 100644 --- a/internal/integrationtest/dns_zone_test.go +++ b/internal/integrationtest/dns_zone_test.go @@ -63,24 +63,17 @@ var ( } DnsDnsZoneRepresentationPrimary = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "name": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_tenancy.test_tenancy.name}.{{.token}}.oci-zone-test`}, - "zone_type": acctest.Representation{RepType: acctest.Required, Create: `PRIMARY`}, - "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")}`}, - "external_masters": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DnsZoneExternalMastersRepresentation}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags2": "freeformTags2"}}, - "scope": acctest.Representation{RepType: acctest.Required, Create: `PRIVATE`}, - "view_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_dns_view.test_view.id}`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "name": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_tenancy.test_tenancy.name}.{{.token}}.oci-zone-test`}, + "zone_type": acctest.Representation{RepType: acctest.Required, Create: `PRIMARY`}, + "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{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags2": "freeformTags2"}}, + "scope": acctest.Representation{RepType: acctest.Required, Create: `PRIVATE`}, + "view_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_dns_view.test_view.id}`}, } DnsDnsZoneRepresentation = acctest.GetUpdatedRepresentationCopy("zone_type", acctest.Representation{RepType: acctest.Required, Create: `SECONDARY`}, DnsDnsZoneRepresentationPrimary) - DnsZoneExternalMastersRepresentation = map[string]interface{}{ - "address": acctest.Representation{RepType: acctest.Required, Create: `77.64.12.1`, Update: `address2`}, - "port": acctest.Representation{RepType: acctest.Optional, Create: `53`, Update: `11`}, - "tsig_key_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_dns_tsig_key.test_tsig_key.id}`}, - } - DnsZoneResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_dns_tsig_key", "test_tsig_key", acctest.Required, acctest.Create, DnsTsigKeyRepresentation) + DefinedTagsDependencies + ` data "oci_identity_tenancy" "test_tenancy" { @@ -109,8 +102,7 @@ func TestDnsZoneResource_basic(t *testing.T) { 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(tokenFn(config+compartmentIdVariableStr+DnsZoneResourceDependencies+ - acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, - acctest.RepresentationCopyWithRemovedProperties(DnsDnsZoneRepresentationPrimary, []string{"external_masters"})), nil), "dns", "zone", t) + acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, DnsDnsZoneRepresentationPrimary), nil), "dns", "zone", t) acctest.ResourceTest(t, testAccCheckDnsZoneDestroy, []resource.TestStep{ // test PRIMARY zone creation @@ -136,8 +128,8 @@ func TestDnsZoneResource_basic(t *testing.T) { // verify Create with optionals { Config: tokenFn(config+compartmentIdVariableStr+DnsZoneResourceDependencies+ - acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, - acctest.RepresentationCopyWithRemovedProperties(DnsDnsZoneRepresentationPrimary, []string{"external_masters"})), nil), + acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, DnsDnsZoneRepresentationPrimary), nil), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("\\.oci-zone-test")), @@ -152,7 +144,6 @@ func TestDnsZoneResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttrSet(resourceName, "version"), resource.TestCheckResourceAttrSet(resourceName, "view_id"), - resource.TestCheckResourceAttr(resourceName, "zone_type", "PRIMARY"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -170,7 +161,7 @@ func TestDnsZoneResource_basic(t *testing.T) { { Config: tokenFn(config+compartmentIdVariableStr+compartmentIdUVariableStr+DnsZoneResourceDependencies+ acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Create, - acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(DnsDnsZoneRepresentationPrimary, []string{"external_masters"}), map[string]interface{}{ + acctest.RepresentationCopyWithNewProperties(DnsDnsZoneRepresentationPrimary, map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, })), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( @@ -202,8 +193,7 @@ func TestDnsZoneResource_basic(t *testing.T) { // verify updates to updatable parameters { Config: tokenFn(config+compartmentIdVariableStr+DnsZoneResourceDependencies+ - acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Update, - acctest.RepresentationCopyWithRemovedProperties(DnsDnsZoneRepresentationPrimary, []string{"external_masters"})), nil), + acctest.GenerateResourceFromRepresentationMap("oci_dns_zone", "test_zone", acctest.Optional, acctest.Update, DnsDnsZoneRepresentationPrimary), nil), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), diff --git a/internal/service/dns/dns_action_create_zone_from_zone_file_resource.go b/internal/service/dns/dns_action_create_zone_from_zone_file_resource.go new file mode 100644 index 00000000000..724afa13d00 --- /dev/null +++ b/internal/service/dns/dns_action_create_zone_from_zone_file_resource.go @@ -0,0 +1,380 @@ +// Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package dns + +import ( + "bytes" + "context" + "io/ioutil" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_dns "github.com/oracle/oci-go-sdk/v65/dns" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DnsActionCreateZoneFromZoneFileResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createDnsActionCreateZoneFromZoneFile, + Read: readDnsActionCreateZoneFromZoneFile, + Delete: deleteDnsActionCreateZoneFromZoneFile, + Schema: map[string]*schema.Schema{ + // Required + "create_zone_from_zone_file_details": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "scope": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "view_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "external_downstreams": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "address": { + Type: schema.TypeString, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + "tsig_key_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "external_masters": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "address": { + Type: schema.TypeString, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + "tsig_key_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "is_protected": { + Type: schema.TypeBool, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "nameservers": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "hostname": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "self": { + Type: schema.TypeString, + Computed: true, + }, + "serial": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "version": { + Type: schema.TypeString, + Computed: true, + }, + "zone_transfer_servers": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "address": { + Type: schema.TypeString, + Computed: true, + }, + "is_transfer_destination": { + Type: schema.TypeBool, + Computed: true, + }, + "is_transfer_source": { + Type: schema.TypeBool, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "zone_type": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createDnsActionCreateZoneFromZoneFile(d *schema.ResourceData, m interface{}) error { + sync := &DnsActionCreateZoneFromZoneFileResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DnsClient() + + return tfresource.CreateResource(d, sync) +} + +func readDnsActionCreateZoneFromZoneFile(d *schema.ResourceData, m interface{}) error { + return nil +} + +func deleteDnsActionCreateZoneFromZoneFile(d *schema.ResourceData, m interface{}) error { + return nil +} + +type DnsActionCreateZoneFromZoneFileResourceCrud struct { + tfresource.BaseCrud + Client *oci_dns.DnsClient + Res *oci_dns.Zone + DisableNotFoundRetries bool +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) CreatedPending() []string { + return []string{ + string(oci_dns.ZoneLifecycleStateCreating), + } +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_dns.ZoneLifecycleStateActive), + } +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) DeletedPending() []string { + return []string{ + string(oci_dns.ZoneLifecycleStateDeleting), + } +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_dns.ZoneLifecycleStateDeleted), + } +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) Create() error { + request := oci_dns.CreateZoneFromZoneFileRequest{} + + if createZoneFromZoneFileDetails, ok := s.D.GetOkExists("create_zone_from_zone_file_details"); ok { + tmp := []byte(createZoneFromZoneFileDetails.(string)) + request.CreateZoneFromZoneFileDetails = ioutil.NopCloser(bytes.NewReader(tmp)) + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if scope, ok := s.D.GetOkExists("scope"); ok { + request.Scope = oci_dns.CreateZoneFromZoneFileScopeEnum(scope.(string)) + } + + if viewId, ok := s.D.GetOkExists("view_id"); ok { + tmp := viewId.(string) + request.ViewId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "dns") + + response, err := s.Client.CreateZoneFromZoneFile(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.Zone + return nil +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) Get() error { + request := oci_dns.GetZoneRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if scope, ok := s.D.GetOkExists("scope"); ok { + request.Scope = oci_dns.GetZoneScopeEnum(scope.(string)) + } + + tmp := s.D.Id() + request.ZoneNameOrId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "dns") + + response, err := s.Client.GetZone(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.Zone + return nil +} + +func (s *DnsActionCreateZoneFromZoneFileResourceCrud) SetData() error { + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + externalDownstreams := []interface{}{} + for _, item := range s.Res.ExternalDownstreams { + externalDownstreams = append(externalDownstreams, ExternalDownstreamToMap(item)) + } + s.D.Set("external_downstreams", externalDownstreams) + + externalMasters := []interface{}{} + for _, item := range s.Res.ExternalMasters { + externalMasters = append(externalMasters, ExternalMasterToMap(item)) + } + s.D.Set("external_masters", externalMasters) + + s.D.Set("freeform_tags", s.Res.FreeformTags) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.IsProtected != nil { + s.D.Set("is_protected", *s.Res.IsProtected) + } + + if s.Res.Name != nil { + s.D.Set("name", *s.Res.Name) + } + + nameservers := []interface{}{} + for _, item := range s.Res.Nameservers { + nameservers = append(nameservers, NameserverToMap(item)) + } + s.D.Set("nameservers", nameservers) + + s.D.Set("scope", s.Res.Scope) + + if s.Res.Self != nil { + s.D.Set("self", *s.Res.Self) + } + + if s.Res.Serial != nil { + s.D.Set("serial", strconv.FormatInt(*s.Res.Serial, 10)) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.Version != nil { + s.D.Set("version", *s.Res.Version) + } + + if s.Res.ViewId != nil { + s.D.Set("view_id", *s.Res.ViewId) + } + + zoneTransferServers := []interface{}{} + for _, item := range s.Res.ZoneTransferServers { + zoneTransferServers = append(zoneTransferServers, ZoneTransferServerToMap(item)) + } + s.D.Set("zone_transfer_servers", zoneTransferServers) + + s.D.Set("zone_type", s.Res.ZoneType) + + return nil +} diff --git a/internal/service/dns/dns_zone_resource.go b/internal/service/dns/dns_zone_resource.go index 90a786ea501..52ee9f47ac1 100644 --- a/internal/service/dns/dns_zone_resource.go +++ b/internal/service/dns/dns_zone_resource.go @@ -11,13 +11,13 @@ import ( "regexp" "strings" - "github.com/oracle/terraform-provider-oci/internal/client" - "github.com/oracle/terraform-provider-oci/internal/tfresource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" oci_dns "github.com/oracle/oci-go-sdk/v65/dns" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" ) func DnsZoneResource() *schema.Resource { @@ -58,6 +58,34 @@ func DnsZoneResource() *schema.Resource { DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, Elem: schema.TypeString, }, + "external_downstreams": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "address": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "port": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "tsig_key_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, "external_masters": { Type: schema.TypeList, Optional: true, @@ -146,6 +174,35 @@ func DnsZoneResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "zone_transfer_servers": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "address": { + Type: schema.TypeString, + Computed: true, + }, + "is_transfer_destination": { + Type: schema.TypeBool, + Computed: true, + }, + "is_transfer_source": { + Type: schema.TypeBool, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, }, } } @@ -244,6 +301,23 @@ func (s *DnsZoneResourceCrud) Create() error { createZoneDetailsRequest.DefinedTags = convertedDefinedTags } + if externalDownstreams, ok := s.D.GetOkExists("external_downstreams"); ok { + interfaces := externalDownstreams.([]interface{}) + tmp := make([]oci_dns.ExternalDownstream, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "external_downstreams", stateDataIndex) + converted, err := s.mapToExternalDownstream(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("external_downstreams") { + createZoneDetailsRequest.ExternalDownstreams = tmp + } + } + if externalMasters, ok := s.D.GetOkExists("external_masters"); ok { interfaces := externalMasters.([]interface{}) tmp := make([]oci_dns.ExternalMaster, len(interfaces)) @@ -366,6 +440,23 @@ func (s *DnsZoneResourceCrud) Update() error { request.DefinedTags = convertedDefinedTags } + if externalDownstreams, ok := s.D.GetOkExists("external_downstreams"); ok { + interfaces := externalDownstreams.([]interface{}) + tmp := make([]oci_dns.ExternalDownstream, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "external_downstreams", stateDataIndex) + converted, err := s.mapToExternalDownstream(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("external_downstreams") { + request.ExternalDownstreams = tmp + } + } + if externalMasters, ok := s.D.GetOkExists("external_masters"); ok { interfaces := externalMasters.([]interface{}) tmp := make([]oci_dns.ExternalMaster, len(interfaces)) @@ -447,6 +538,12 @@ func (s *DnsZoneResourceCrud) SetData() error { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } + externalDownstreams := []interface{}{} + for _, item := range s.Res.ExternalDownstreams { + externalDownstreams = append(externalDownstreams, ExternalDownstreamToMap(item)) + } + s.D.Set("external_downstreams", externalDownstreams) + externalMasters := []interface{}{} for _, item := range s.Res.ExternalMasters { externalMasters = append(externalMasters, ExternalMasterToMap(item)) @@ -499,9 +596,54 @@ func (s *DnsZoneResourceCrud) SetData() error { s.D.Set("is_protected", *s.Res.IsProtected) } + zoneTransferServers := []interface{}{} + for _, item := range s.Res.ZoneTransferServers { + zoneTransferServers = append(zoneTransferServers, ZoneTransferServerToMap(item)) + } + s.D.Set("zone_transfer_servers", zoneTransferServers) + return nil } +func (s *DnsZoneResourceCrud) mapToExternalDownstream(fieldKeyFormat string) (oci_dns.ExternalDownstream, error) { + result := oci_dns.ExternalDownstream{} + + if address, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "address")); ok { + tmp := address.(string) + result.Address = &tmp + } + + if port, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "port")); ok { + tmp := port.(int) + result.Port = &tmp + } + + if tsigKeyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "tsig_key_id")); ok { + tmp := tsigKeyId.(string) + result.TsigKeyId = &tmp + } + + return result, nil +} + +func ExternalDownstreamToMap(obj oci_dns.ExternalDownstream) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Address != nil { + result["address"] = string(*obj.Address) + } + + if obj.Port != nil { + result["port"] = int(*obj.Port) + } + + if obj.TsigKeyId != nil { + result["tsig_key_id"] = string(*obj.TsigKeyId) + } + + return result +} + func (s *DnsZoneResourceCrud) mapToExternalMaster(fieldKeyFormat string) (oci_dns.ExternalMaster, error) { result := oci_dns.ExternalMaster{} @@ -551,6 +693,28 @@ func NameserverToMap(obj oci_dns.Nameserver) map[string]interface{} { return result } +func ZoneTransferServerToMap(obj oci_dns.ZoneTransferServer) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Address != nil { + result["address"] = string(*obj.Address) + } + + if obj.IsTransferDestination != nil { + result["is_transfer_destination"] = bool(*obj.IsTransferDestination) + } + + if obj.IsTransferSource != nil { + result["is_transfer_source"] = bool(*obj.IsTransferSource) + } + + if obj.Port != nil { + result["port"] = int(*obj.Port) + } + + return result +} + func (s *DnsZoneResourceCrud) updateCompartment(compartment interface{}) error { changeCompartmentRequest := oci_dns.ChangeZoneCompartmentRequest{} diff --git a/internal/service/dns/register_resource.go b/internal/service/dns/register_resource.go index ed2c7538a41..67a092b793f 100644 --- a/internal/service/dns/register_resource.go +++ b/internal/service/dns/register_resource.go @@ -6,6 +6,7 @@ package dns import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterResource() { + tfresource.RegisterResource("oci_dns_action_create_zone_from_zone_file", DnsActionCreateZoneFromZoneFileResource()) tfresource.RegisterResource("oci_dns_record", DnsRecordResource()) tfresource.RegisterResource("oci_dns_resolver", DnsResolverResource()) tfresource.RegisterResource("oci_dns_resolver_endpoint", DnsResolverEndpointResource()) diff --git a/website/docs/d/dns_zones.html.markdown b/website/docs/d/dns_zones.html.markdown index 6245f61ba9c..11bf6d53868 100644 --- a/website/docs/d/dns_zones.html.markdown +++ b/website/docs/d/dns_zones.html.markdown @@ -68,6 +68,10 @@ The following attributes are exported: * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). **Example:** `{"Operations.CostCenter": "42"}` +* `external_downstreams` - External secondary servers for the zone. This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + * `address` - The server's IP address (IPv4 or IPv6). + * `port` - The server's port. Port value must be a value of 53, otherwise omit the port value. + * `tsig_key_id` - The OCID of the TSIG key. A TSIG key is used to secure DNS messages (in this case, zone transfers) between two systems that both have the (shared) secret. * `external_masters` - External master servers for the zone. `externalMasters` becomes a required parameter when the `zoneType` value is `SECONDARY`. * `address` - The server's IP address (IPv4 or IPv6). * `port` - The server's port. Port value must be a value of 53, otherwise omit the port value. @@ -89,5 +93,9 @@ The following attributes are exported: **Example:** `2016-07-22T17:23:59:60Z` * `version` - Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. * `view_id` - The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. +* `zone_transfer_servers` - The Oracle Cloud Infrastructure nameservers that transfer the zone data with external nameservers. + * `address` - The server's IP address (IPv4 or IPv6). + * `is_transfer_destination` - A Boolean flag indicating whether or not the server is a zone data transfer destination. + * `is_transfer_source` - A Boolean flag indicating whether or not the server is a zone data transfer source. * `zone_type` - The type of the zone. Must be either `PRIMARY` or `SECONDARY`. `SECONDARY` is only supported for GLOBAL zones. diff --git a/website/docs/r/dns_action_create_zone_from_zone_file.html.markdown b/website/docs/r/dns_action_create_zone_from_zone_file.html.markdown new file mode 100644 index 00000000000..94f59d314d9 --- /dev/null +++ b/website/docs/r/dns_action_create_zone_from_zone_file.html.markdown @@ -0,0 +1,100 @@ +--- +subcategory: "DNS" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_dns_action_create_zone_from_zone_file" +sidebar_current: "docs-oci-resource-dns-action_create_zone_from_zone_file" +description: |- + Provides the Action Create Zone From Zone File resource in Oracle Cloud Infrastructure DNS service +--- + +# oci_dns_action_create_zone_from_zone_file +This resource provides the Action Create Zone From Zone File resource in Oracle Cloud Infrastructure DNS service. + +Creates a new zone from a zone file in the specified compartment. + +After the zone has been created, it should be further managed by importing it to an `oci_dns_zone` resource. + + +## Example Usage + +```hcl +resource "oci_dns_action_create_zone_from_zone_file" "test_action_create_zone_from_zone_file" { + #Required + create_zone_from_zone_file_details = var.action_create_zone_from_zone_file_create_zone_from_zone_file_details + compartment_id = var.compartment_id + + #Optional + scope = var.action_create_zone_from_zone_file_scope + view_id = oci_dns_view.test_view.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `create_zone_from_zone_file_details` - (Required) The zone file contents. +* `compartment_id` - (Required) The OCID of the compartment the resource belongs to. +* `scope` - (Optional) Specifies to operate only on resources that have a matching DNS scope. +* `view_id` - (Optional) The OCID of the view the resource is associated with. + + +** IMPORTANT ** +Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values + +## Attributes Reference + +The following attributes are exported: + +* `compartment_id` - The OCID of the compartment containing the zone. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + + **Example:** `{"Operations": {"CostCenter": "42"}}` +* `external_downstreams` - External secondary servers for the zone. This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + * `address` - The server's IP address (IPv4 or IPv6). + * `port` - The server's port. Port value must be a value of 53, otherwise omit the port value. + * `tsig_key_id` - The OCID of the TSIG key. A TSIG key is used to secure DNS messages (in this case, zone transfers) between two systems that both have the (shared) secret. +* `external_masters` - External master servers for the zone. `externalMasters` becomes a required parameter when the `zoneType` value is `SECONDARY`. + * `address` - The server's IP address (IPv4 or IPv6). + * `port` - The server's port. Port value must be a value of 53, otherwise omit the port value. + * `tsig_key_id` - The OCID of the TSIG key. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + + **Example:** `{"Department": "Finance"}` +* `id` - The OCID of the zone. +* `is_protected` - A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. +* `name` - The name of the zone. +* `nameservers` - The authoritative nameservers for the zone. + * `hostname` - The hostname of the nameserver. +* `scope` - The scope of the zone. +* `self` - The canonical absolute URL of the resource. +* `serial` - The current serial of the zone. As seen in the zone's SOA record. +* `state` - The current state of the zone resource. +* `time_created` - The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339. + + **Example:** `2016-07-22T17:23:59:60Z` +* `version` - Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. +* `view_id` - The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. +* `zone_transfer_servers` - The Oracle Cloud Infrastructure nameservers that transfer the zone data with external nameservers. + * `address` - The server's IP address (IPv4 or IPv6). + * `is_transfer_destination` - A Boolean flag indicating whether or not the server is a zone data transfer destination. + * `is_transfer_source` - A Boolean flag indicating whether or not the server is a zone data transfer source. + * `port` - The server's port. +* `zone_type` - The type of the zone. Must be either `PRIMARY` or `SECONDARY`. `SECONDARY` is only supported for GLOBAL zones. + +## 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 Action Create Zone From Zone File + * `update` - (Defaults to 20 minutes), when updating the Action Create Zone From Zone File + * `delete` - (Defaults to 20 minutes), when destroying the Action Create Zone From Zone File + + +## Import + +ActionCreateZoneFromZoneFile can be imported using the `id`, e.g. + +``` +$ terraform import oci_dns_action_create_zone_from_zone_file.test_action_create_zone_from_zone_file "id" +``` + diff --git a/website/docs/r/dns_zone.html.markdown b/website/docs/r/dns_zone.html.markdown index 4876395e9fc..8834b1f2d06 100644 --- a/website/docs/r/dns_zone.html.markdown +++ b/website/docs/r/dns_zone.html.markdown @@ -10,8 +10,12 @@ description: |- # oci_dns_zone This resource provides the Zone resource in Oracle Cloud Infrastructure DNS service. -Creates a new zone in the specified compartment. Additionally, for Private DNS, -the `viewId` field is required when creating private zones. +Creates a new zone in the specified compartment. For global zones, if the `Content-Type` header for the request +is `text/dns`, the `compartmentId` query parameter is required. `text/dns` for the `Content-Type` header is +not supported for private zones. Query parameter scope with a value of `PRIVATE` is required when creating a +private zone. Private zones must have a zone type of `PRIMARY`. Creating a private zone at or under +`oraclevcn.com` within the default protected view of a VCN-dedicated resolver is not permitted. + ## Example Usage @@ -24,6 +28,14 @@ resource "oci_dns_zone" "test_zone" { #Optional defined_tags = var.zone_defined_tags + external_downstreams { + #Required + address = var.zone_external_downstreams_address + + #Optional + port = var.zone_external_downstreams_port + tsig_key_id = oci_dns_tsig_key.test_tsig_key.id + } external_masters { #Required address = var.zone_external_masters_address @@ -45,7 +57,11 @@ The following arguments are supported: * `compartment_id` - (Required) (Updatable) The OCID of the compartment the resource belongs to. * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). - **Example:** `{"Operations.CostCenter": "42"}` + **Example:** `{"Operations": {"CostCenter": "42"}}` +* `external_downstreams` - (Optional) (Updatable) External secondary servers for the zone. This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + * `address` - (Required) (Updatable) The server's IP address (IPv4 or IPv6). + * `port` - (Optional) (Updatable) The server's port. Port value must be a value of 53, otherwise omit the port value. + * `tsig_key_id` - (Optional) (Updatable) The OCID of the TSIG key. A TSIG key is used to secure DNS messages (in this case, zone transfers) between two systems that both have the (shared) secret. * `external_masters` - (Optional) (Updatable) External master servers for the zone. `externalMasters` becomes a required parameter when the `zoneType` value is `SECONDARY`. * `address` - (Required) (Updatable) The server's IP address (IPv4 or IPv6). * `port` - (Optional) (Updatable) The server's port. Port value must be a value of 53, otherwise omit the port value. @@ -70,7 +86,11 @@ The following attributes are exported: * `compartment_id` - The OCID of the compartment containing the zone. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). - **Example:** `{"Operations.CostCenter": "42"}` + **Example:** `{"Operations": {"CostCenter": "42"}}` +* `external_downstreams` - External secondary servers for the zone. This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + * `address` - The server's IP address (IPv4 or IPv6). + * `port` - The server's port. Port value must be a value of 53, otherwise omit the port value. + * `tsig_key_id` - The OCID of the TSIG key. A TSIG key is used to secure DNS messages (in this case, zone transfers) between two systems that both have the (shared) secret. * `external_masters` - External master servers for the zone. `externalMasters` becomes a required parameter when the `zoneType` value is `SECONDARY`. * `address` - The server's IP address (IPv4 or IPv6). * `port` - The server's port. Port value must be a value of 53, otherwise omit the port value. @@ -92,6 +112,11 @@ The following attributes are exported: **Example:** `2016-07-22T17:23:59:60Z` * `version` - Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. * `view_id` - The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. +* `zone_transfer_servers` - The Oracle Cloud Infrastructure nameservers that transfer the zone data with external nameservers. + * `address` - The server's IP address (IPv4 or IPv6). + * `is_transfer_destination` - A Boolean flag indicating whether or not the server is a zone data transfer destination. + * `is_transfer_source` - A Boolean flag indicating whether or not the server is a zone data transfer source. + * `port` - The server's port. * `zone_type` - The type of the zone. Must be either `PRIMARY` or `SECONDARY`. `SECONDARY` is only supported for GLOBAL zones. ## Timeouts @@ -104,7 +129,7 @@ The `timeouts` block allows you to specify [timeouts](https://registry.terraform ## Import -Zones can be imported using their OCID, e.g. +Zones can be imported using the `id`, e.g. ``` $ terraform import oci_dns_zone.test_zone "id" From b20f32516ade70d2e627f3ed1aa416b6ccd856bc Mon Sep 17 00:00:00 2001 From: Terraform Team Automation Date: Fri, 19 May 2023 07:01:55 +0000 Subject: [PATCH 07/16] Added - Support for Node Subsetting | ADB-D --- examples/database/atp-d/main.tf | 7 + ...frastructure_un_allocated_resource_test.go | 2 +- ...frastructure_un_allocated_resource_test.go | 60 ++++++ ...cloud_autonomous_vm_cluster_data_source.go | 2 + ...se_cloud_autonomous_vm_cluster_resource.go | 2 + ...loud_autonomous_vm_clusters_data_source.go | 2 + ...cture_un_allocated_resource_data_source.go | 20 ++ ...cture_un_allocated_resource_data_source.go | 175 ++++++++++++++++++ .../service/database/register_datasource.go | 1 + ...utonomous_container_database.html.markdown | 2 +- ...tonomous_container_databases.html.markdown | 2 +- ...database_autonomous_database.html.markdown | 54 ++++-- ...atabase_autonomous_databases.html.markdown | 39 +++- ..._autonomous_databases_clones.html.markdown | 42 +++-- ...tonomous_db_preview_versions.html.markdown | 4 +- ...abase_autonomous_db_versions.html.markdown | 4 +- ...tabase_autonomous_vm_cluster.html.markdown | 2 +- ...abase_autonomous_vm_clusters.html.markdown | 2 +- ..._cloud_autonomous_vm_cluster.html.markdown | 7 +- ...cloud_autonomous_vm_clusters.html.markdown | 7 +- ...ucture_un_allocated_resource.html.markdown | 4 + ...base_upgrade_history_entries.html.markdown | 4 +- ...tabase_upgrade_history_entry.html.markdown | 4 +- ...ucture_un_allocated_resource.html.markdown | 49 +++++ ...utonomous_container_database.html.markdown | 4 +- ...database_autonomous_database.html.markdown | 104 +++++++---- ...tabase_autonomous_vm_cluster.html.markdown | 4 +- ..._cloud_autonomous_vm_cluster.html.markdown | 13 +- .../docs/r/database_database.html.markdown | 4 +- .../r/database_database_upgrade.html.markdown | 4 +- .../docs/r/database_db_system.html.markdown | 4 +- ...gable_databases_remote_clone.html.markdown | 2 +- 32 files changed, 538 insertions(+), 98 deletions(-) create mode 100644 internal/integrationtest/database_exadata_infrastructure_un_allocated_resource_test.go create mode 100644 internal/service/database/database_exadata_infrastructure_un_allocated_resource_data_source.go create mode 100644 website/docs/d/database_exadata_infrastructure_un_allocated_resource.html.markdown diff --git a/examples/database/atp-d/main.tf b/examples/database/atp-d/main.tf index 9b04a72c05b..e7e8cb1c700 100644 --- a/examples/database/atp-d/main.tf +++ b/examples/database/atp-d/main.tf @@ -59,6 +59,10 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container db_version = "19.18.0.1.0" } +variable "cloud_exadata_infrastructure_un_allocated_resource_db_servers" { + default = [] +} + resource "random_string" "autonomous_database_admin_password" { length = 16 min_numeric = 1 @@ -146,4 +150,7 @@ output "autonomous_container_databases" { data "oci_database_cloud_exadata_infrastructure_un_allocated_resource" "test_cloud_exadata_infrastructure_un_allocated_resources" { #Required cloud_exadata_infrastructure_id = oci_database_cloud_exadata_infrastructure.test_cloud_exadata_infrastructure.id + + #Optional + db_servers = var.cloud_exadata_infrastructure_un_allocated_resource_db_servers } diff --git a/internal/integrationtest/database_cloud_exadata_infrastructure_un_allocated_resource_test.go b/internal/integrationtest/database_cloud_exadata_infrastructure_un_allocated_resource_test.go index 857264d7492..080b39c07ae 100644 --- a/internal/integrationtest/database_cloud_exadata_infrastructure_un_allocated_resource_test.go +++ b/internal/integrationtest/database_cloud_exadata_infrastructure_un_allocated_resource_test.go @@ -18,6 +18,7 @@ import ( var ( DatabaseCloudExadataInfrastructureUnAllocatedResourceSingularDataSourceRepresentation = map[string]interface{}{ "cloud_exadata_infrastructure_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_cloud_exadata_infrastructure.test_cloud_exadata_infrastructure.id}`}, + "db_servers": acctest.Representation{RepType: acctest.Optional, Create: []string{`dbServers`}}, } DatabaseCloudExadataInfrastructureUnAllocatedResourceResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_database_cloud_exadata_infrastructure", "test_cloud_exadata_infrastructure", acctest.Required, acctest.Create, DatabaseCloudExadataInfrastructureRepresentation) + @@ -46,7 +47,6 @@ func TestDatabaseCloudExadataInfrastructureUnAllocatedResourceResource_basic(t * compartmentIdVariableStr + DatabaseCloudExadataInfrastructureUnAllocatedResourceResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "cloud_exadata_infrastructure_id"), - resource.TestCheckResourceAttr(singularDatasourceName, "cloud_autonomous_vm_clusters.#", "0"), resource.TestCheckResourceAttrSet(singularDatasourceName, "cloud_exadata_infrastructure_display_name"), resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_storage_in_tbs"), diff --git a/internal/integrationtest/database_exadata_infrastructure_un_allocated_resource_test.go b/internal/integrationtest/database_exadata_infrastructure_un_allocated_resource_test.go new file mode 100644 index 00000000000..338ed88aff4 --- /dev/null +++ b/internal/integrationtest/database_exadata_infrastructure_un_allocated_resource_test.go @@ -0,0 +1,60 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + DatabaseDatabaseExadataInfrastructureUnAllocatedResourceSingularDataSourceRepresentation = map[string]interface{}{ + "exadata_infrastructure_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_exadata_infrastructure.test_exadata_infrastructure.id}`}, + "db_servers": acctest.Representation{RepType: acctest.Optional, Create: []string{`dbServers`}}, + } + + DatabaseExadataInfrastructureUnAllocatedResourceResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_database_exadata_infrastructure", "test_exadata_infrastructure", acctest.Required, acctest.Create, DatabaseExadataInfrastructureRepresentation) +) + +// issue-routing-tag: database/ExaCC +func TestDatabaseExadataInfrastructureUnAllocatedResourceResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatabaseExadataInfrastructureUnAllocatedResourceResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + singularDatasourceName := "data.oci_database_exadata_infrastructure_un_allocated_resource.test_exadata_infrastructure_un_allocated_resource" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_database_exadata_infrastructure_un_allocated_resource", "test_exadata_infrastructure_un_allocated_resource", acctest.Required, acctest.Create, DatabaseDatabaseExadataInfrastructureUnAllocatedResourceSingularDataSourceRepresentation) + + compartmentIdVariableStr + DatabaseExadataInfrastructureUnAllocatedResourceResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_infrastructure_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "autonomous_vm_clusters.#", "0"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "display_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_storage_in_tbs"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "local_storage_in_gbs"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "memory_in_gbs"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "ocpus"), + ), + }, + }) +} diff --git a/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go b/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go index 5fb858c3d71..8053bed2656 100644 --- a/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go +++ b/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go @@ -120,6 +120,8 @@ func (s *DatabaseCloudAutonomousVmClusterDataSourceCrud) SetData() error { s.D.Set("db_node_storage_size_in_gbs", *s.Res.DbNodeStorageSizeInGBs) } + s.D.Set("db_servers", s.Res.DbServers) + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } diff --git a/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go b/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go index 86fbdc5288f..05b0ac9d89f 100644 --- a/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go +++ b/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go @@ -874,6 +874,8 @@ func (s *DatabaseCloudAutonomousVmClusterResourceCrud) SetData() error { s.D.Set("db_node_storage_size_in_gbs", *s.Res.DbNodeStorageSizeInGBs) } + s.D.Set("db_servers", s.Res.DbServers) + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } diff --git a/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go b/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go index 3177e5ef541..b3ef3763d38 100644 --- a/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go +++ b/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go @@ -178,6 +178,8 @@ func (s *DatabaseCloudAutonomousVmClustersDataSourceCrud) SetData() error { cloudAutonomousVmCluster["db_node_storage_size_in_gbs"] = *r.DbNodeStorageSizeInGBs } + cloudAutonomousVmCluster["db_servers"] = r.DbServers + if r.DefinedTags != nil { cloudAutonomousVmCluster["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) } diff --git a/internal/service/database/database_cloud_exadata_infrastructure_un_allocated_resource_data_source.go b/internal/service/database/database_cloud_exadata_infrastructure_un_allocated_resource_data_source.go index 8b7f12570c2..bcef4512650 100644 --- a/internal/service/database/database_cloud_exadata_infrastructure_un_allocated_resource_data_source.go +++ b/internal/service/database/database_cloud_exadata_infrastructure_un_allocated_resource_data_source.go @@ -20,6 +20,13 @@ func DatabaseCloudExadataInfrastructureUnAllocatedResourceDataSource() *schema.R Type: schema.TypeString, Required: true, }, + "db_servers": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, // Computed "cloud_autonomous_vm_clusters": { Type: schema.TypeList, @@ -92,6 +99,19 @@ func (s *DatabaseCloudExadataInfrastructureUnAllocatedResourceDataSourceCrud) Ge request.CloudExadataInfrastructureId = &tmp } + if dbServers, ok := s.D.GetOkExists("db_servers"); ok { + interfaces := dbServers.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("db_servers") { + request.DbServers = tmp + } + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "database") response, err := s.Client.GetCloudExadataInfrastructureUnallocatedResources(context.Background(), request) diff --git a/internal/service/database/database_exadata_infrastructure_un_allocated_resource_data_source.go b/internal/service/database/database_exadata_infrastructure_un_allocated_resource_data_source.go new file mode 100644 index 00000000000..239dc4a436a --- /dev/null +++ b/internal/service/database/database_exadata_infrastructure_un_allocated_resource_data_source.go @@ -0,0 +1,175 @@ +// 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" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DatabaseExadataInfrastructureUnAllocatedResourceDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularDatabaseExadataInfrastructureUnAllocatedResource, + Schema: map[string]*schema.Schema{ + "db_servers": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "exadata_infrastructure_id": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "autonomous_vm_clusters": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "id": { + Type: schema.TypeString, + Computed: true, + }, + "un_allocated_adb_storage_in_tbs": { + Type: schema.TypeFloat, + Computed: true, + }, + }, + }, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "exadata_storage_in_tbs": { + Type: schema.TypeFloat, + Computed: true, + }, + "local_storage_in_gbs": { + Type: schema.TypeInt, + Computed: true, + }, + "memory_in_gbs": { + Type: schema.TypeInt, + Computed: true, + }, + "ocpus": { + Type: schema.TypeInt, + Computed: true, + }, + }, + } +} + +func readSingularDatabaseExadataInfrastructureUnAllocatedResource(d *schema.ResourceData, m interface{}) error { + sync := &DatabaseExadataInfrastructureUnAllocatedResourceDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatabaseClient() + + return tfresource.ReadResource(sync) +} + +type DatabaseExadataInfrastructureUnAllocatedResourceDataSourceCrud struct { + D *schema.ResourceData + Client *oci_database.DatabaseClient + Res *oci_database.GetExadataInfrastructureUnAllocatedResourcesResponse +} + +func (s *DatabaseExadataInfrastructureUnAllocatedResourceDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatabaseExadataInfrastructureUnAllocatedResourceDataSourceCrud) Get() error { + request := oci_database.GetExadataInfrastructureUnAllocatedResourcesRequest{} + + if dbServers, ok := s.D.GetOkExists("db_servers"); ok { + interfaces := dbServers.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("db_servers") { + request.DbServers = tmp + } + } + + if exadataInfrastructureId, ok := s.D.GetOkExists("exadata_infrastructure_id"); ok { + tmp := exadataInfrastructureId.(string) + request.ExadataInfrastructureId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "database") + + response, err := s.Client.GetExadataInfrastructureUnAllocatedResources(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *DatabaseExadataInfrastructureUnAllocatedResourceDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + autonomousVmClusters := []interface{}{} + for _, item := range s.Res.AutonomousVmClusters { + autonomousVmClusters = append(autonomousVmClusters, AutonomousVmClusterResourceDetailsToMap(item)) + } + s.D.Set("autonomous_vm_clusters", autonomousVmClusters) + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + if s.Res.ExadataStorageInTBs != nil { + s.D.Set("exadata_storage_in_tbs", *s.Res.ExadataStorageInTBs) + } + + if s.Res.LocalStorageInGbs != nil { + s.D.Set("local_storage_in_gbs", *s.Res.LocalStorageInGbs) + } + + if s.Res.MemoryInGBs != nil { + s.D.Set("memory_in_gbs", *s.Res.MemoryInGBs) + } + + if s.Res.Ocpus != nil { + s.D.Set("ocpus", *s.Res.Ocpus) + } + + return nil +} + +func AutonomousVmClusterResourceDetailsToMap(obj oci_database.AutonomousVmClusterResourceDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.UnAllocatedAdbStorageInTBs != nil { + result["un_allocated_adb_storage_in_tbs"] = float64(*obj.UnAllocatedAdbStorageInTBs) + } + + return result +} diff --git a/internal/service/database/register_datasource.go b/internal/service/database/register_datasource.go index 2a922a1abd8..817e1333c2f 100644 --- a/internal/service/database/register_datasource.go +++ b/internal/service/database/register_datasource.go @@ -76,6 +76,7 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_database_db_versions", DatabaseDbVersionsDataSource()) tfresource.RegisterDatasource("oci_database_exadata_infrastructure", DatabaseExadataInfrastructureDataSource()) tfresource.RegisterDatasource("oci_database_exadata_infrastructure_download_config_file", DatabaseExadataInfrastructureDownloadConfigFileDataSource()) + tfresource.RegisterDatasource("oci_database_exadata_infrastructure_un_allocated_resource", DatabaseExadataInfrastructureUnAllocatedResourceDataSource()) tfresource.RegisterDatasource("oci_database_exadata_infrastructures", DatabaseExadataInfrastructuresDataSource()) tfresource.RegisterDatasource("oci_database_exadata_iorm_config", DatabaseExadataIormConfigDataSource()) tfresource.RegisterDatasource("oci_database_external_container_database", DatabaseExternalContainerDatabaseDataSource()) diff --git a/website/docs/d/database_autonomous_container_database.html.markdown b/website/docs/d/database_autonomous_container_database.html.markdown index 34f75376ec7..3f428d786af 100644 --- a/website/docs/d/database_autonomous_container_database.html.markdown +++ b/website/docs/d/database_autonomous_container_database.html.markdown @@ -48,7 +48,7 @@ The following attributes are exported: * `cloud_autonomous_vm_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cloud Autonomous Exadata VM Cluster. * `compartment_id` - The OCID of the compartment. * `compute_model` - The compute model of the Autonomous VM Cluster. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. -* `db_name` - The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. +* `db_name` - The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_unique_name` - **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. * `db_version` - Oracle Database version of the Autonomous Container Database. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/website/docs/d/database_autonomous_container_databases.html.markdown b/website/docs/d/database_autonomous_container_databases.html.markdown index 3115c6c4c1e..6c6ea096c8b 100644 --- a/website/docs/d/database_autonomous_container_databases.html.markdown +++ b/website/docs/d/database_autonomous_container_databases.html.markdown @@ -73,7 +73,7 @@ The following attributes are exported: * `cloud_autonomous_vm_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cloud Autonomous Exadata VM Cluster. * `compartment_id` - The OCID of the compartment. * `compute_model` - The compute model of the Autonomous VM Cluster. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. -* `db_name` - The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. +* `db_name` - The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_unique_name` - **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. * `db_version` - Oracle Database version of the Autonomous Container Database. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/website/docs/d/database_autonomous_database.html.markdown b/website/docs/d/database_autonomous_database.html.markdown index 3f8b2e70647..192aa0e413e 100644 --- a/website/docs/d/database_autonomous_database.html.markdown +++ b/website/docs/d/database_autonomous_database.html.markdown @@ -88,10 +88,12 @@ The following attributes are exported: * `db_name` - The database name. * `db_version` - A valid Oracle Database version for Autonomous Database. * `db_workload` - The Autonomous Database workload type. The following values are valid: - * OLTP - indicates an Autonomous Transaction Processing database - * DW - indicates an Autonomous Data Warehouse database - * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + * OLTP - indicates an Autonomous Transaction Processing database + * DW - indicates an Autonomous Data Warehouse database + * AJD - indicates an Autonomous JSON Database + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `disaster_recovery_region_type` - The disaster recovery (DR) region type of the Autonomous Database. For Shared Autonomous Databases, DR associations have designated primary and standby regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region. * `display_name` - The user-friendly name for the Autonomous Database. The name does not have to be unique. @@ -106,7 +108,9 @@ The following attributes are exported: * `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. +* `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. @@ -118,7 +122,9 @@ The following attributes are exported: * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Databases on shared Exadata infrastructure. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. * `is_preview` - Indicates if the Autonomous Database version is a preview version. * `is_reconnect_clone_enabled` - Indicates if the refreshable clone can be reconnected to its source database. -* `is_refreshable_clone` - Indicates whether the Autonomous Database is a refreshable clone. +* `is_refreshable_clone` - Indicates if the Autonomous Database is a refreshable clone. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. @@ -130,7 +136,9 @@ The following attributes are exported: * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. -* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. +* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. @@ -145,7 +153,7 @@ The following attributes are exported: * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. * `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU in the Autonomous VM Cluster. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. @@ -162,11 +170,15 @@ The following attributes are exported: For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. - **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. -* `open_mode` - The `DATABASE OPEN` mode. You can open the database in `READ_ONLY` or `READ_WRITE` mode. + **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. +* `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for shared Exadata infrastructure, standby databases located in the same region as the source primary database do not have OCIDs. -* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only to admin users. +* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `private_endpoint` - The private endpoint for the resource. * `private_endpoint_ip` - The private endpoint Ip address for the resource. * `private_endpoint_label` - The private endpoint label for the resource. @@ -176,11 +188,13 @@ The following attributes are exported: * `remote_disaster_recovery_configuration` - Configurations of a Disaster Recovery. * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. -* `scheduled_operations` - list of scheduled operations - * `day_of_week` - Day of the week. - * `name` - Name of the day of the week. - * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" - * `scheduled_stop_time` - auto stop time. value must be of ISO-8601 format "HH:mm" +* `scheduled_operations` - The list of scheduled operations. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + * `day_of_week` - Day of the week. + * `name` - Name of the day of the week. + * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" + * `scheduled_stop_time` - auto stop time. value must be of ISO-8601 format "HH:mm" * `service_console_url` - The URL of the Service Console for the Autonomous Database. * `source_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source Autonomous Database that was cloned to create the current Autonomous Database. * `standby_db` - **Deprecated** Autonomous Data Guard standby database details. @@ -193,7 +207,9 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. @@ -227,5 +243,7 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. diff --git a/website/docs/d/database_autonomous_databases.html.markdown b/website/docs/d/database_autonomous_databases.html.markdown index 535a7f02487..237f0c9116e 100644 --- a/website/docs/d/database_autonomous_databases.html.markdown +++ b/website/docs/d/database_autonomous_databases.html.markdown @@ -117,7 +117,9 @@ The following attributes are exported: * OLTP - indicates an Autonomous Transaction Processing database * DW - indicates an Autonomous Data Warehouse database * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `disaster_recovery_region_type` - The disaster recovery (DR) region type of the Autonomous Database. For Shared Autonomous Databases, DR associations have designated primary and standby regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region. * `display_name` - The user-friendly name for the Autonomous Database. The name does not have to be unique. @@ -132,7 +134,9 @@ The following attributes are exported: * `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. +* `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. @@ -144,7 +148,9 @@ The following attributes are exported: * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Databases on shared Exadata infrastructure. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. * `is_preview` - Indicates if the Autonomous Database version is a preview version. * `is_reconnect_clone_enabled` - Indicates if the refreshable clone can be reconnected to its source database. -* `is_refreshable_clone` - Indicates whether the Autonomous Database is a refreshable clone. +* `is_refreshable_clone` - Indicates if the Autonomous Database is a refreshable clone. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. @@ -156,7 +162,9 @@ The following attributes are exported: * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. -* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. +* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. @@ -171,7 +179,7 @@ The following attributes are exported: * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. * `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU in the Autonomous VM Cluster. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** @@ -185,10 +193,14 @@ The following attributes are exported: For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. -* `open_mode` - The `DATABASE OPEN` mode. You can open the database in `READ_ONLY` or `READ_WRITE` mode. +* `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for shared Exadata infrastructure, standby databases located in the same region as the source primary database do not have OCIDs. -* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only to admin users. +* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `private_endpoint` - The private endpoint for the resource. * `private_endpoint_ip` - The private endpoint Ip address for the resource. * `private_endpoint_label` - The private endpoint label for the resource. @@ -198,7 +210,9 @@ The following attributes are exported: * `remote_disaster_recovery_configuration` - Configurations of a Disaster Recovery. * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. -* `scheduled_operations` - list of scheduled operations +* `scheduled_operations` - The list of scheduled operations. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `day_of_week` - Day of the week. * `name` - Name of the day of the week. * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" @@ -215,7 +229,9 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. @@ -249,4 +265,7 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + diff --git a/website/docs/d/database_autonomous_databases_clones.html.markdown b/website/docs/d/database_autonomous_databases_clones.html.markdown index 407db9db0fe..3f9673b3620 100644 --- a/website/docs/d/database_autonomous_databases_clones.html.markdown +++ b/website/docs/d/database_autonomous_databases_clones.html.markdown @@ -107,7 +107,9 @@ The following attributes are exported: * OLTP - indicates an Autonomous Transaction Processing database * DW - indicates an Autonomous Data Warehouse database * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `disaster_recovery_region_type` - The disaster recovery (DR) region type of the Autonomous Database. For Shared Autonomous Databases, DR associations have designated primary and standby regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region. * `display_name` - The user-friendly name for the Autonomous Database. The name does not have to be unique. @@ -122,7 +124,9 @@ The following attributes are exported: * `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. +* `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. @@ -134,7 +138,9 @@ The following attributes are exported: * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Databases on shared Exadata infrastructure. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. * `is_preview` - Indicates if the Autonomous Database version is a preview version. * `is_reconnect_clone_enabled` - Indicates if the refreshable clone can be reconnected to its source database. -* `is_refreshable_clone` - Indicates whether the Autonomous Database is a refreshable clone. +* `is_refreshable_clone` - Indicates if the Autonomous Database is a refreshable clone. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. @@ -146,7 +152,9 @@ The following attributes are exported: * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. -* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. +* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. @@ -161,7 +169,7 @@ The following attributes are exported: * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. * `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU in the Autonomous VM Cluster. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** @@ -175,20 +183,28 @@ The following attributes are exported: For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. -* `open_mode` - The `DATABASE OPEN` mode. You can open the database in `READ_ONLY` or `READ_WRITE` mode. +* `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for shared Exadata infrastructure, standby databases located in the same region as the source primary database do not have OCIDs. -* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only to admin users. +* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `private_endpoint` - The private endpoint for the resource. * `private_endpoint_ip` - The private endpoint Ip address for the resource. -* `private_endpoint_label` - The private endpoint label for the resource. Setting this to an empty string, after the private endpoint database gets created, will change the same private endpoint database to the public endpoint database. +* `private_endpoint_label` - The resource's private endpoint label. Setting this to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. + + This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `provisionable_cpus` - An array of CPU values that an Autonomous Database can be scaled to. * `refreshable_mode` - The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. * `refreshable_status` - The refresh status of the clone. REFRESHING indicates that the clone is currently being refreshed with data from the source Autonomous Database. * `remote_disaster_recovery_configuration` - Configurations of a Disaster Recovery. * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. -* `scheduled_operations` - list of scheduled operations +* `scheduled_operations` - The list of scheduled operations. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `day_of_week` - Day of the week. * `name` - Name of the day of the week. * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" @@ -205,7 +221,9 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. @@ -239,5 +257,7 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. diff --git a/website/docs/d/database_autonomous_db_preview_versions.html.markdown b/website/docs/d/database_autonomous_db_preview_versions.html.markdown index 551602d5aba..6a528836770 100644 --- a/website/docs/d/database_autonomous_db_preview_versions.html.markdown +++ b/website/docs/d/database_autonomous_db_preview_versions.html.markdown @@ -44,7 +44,9 @@ The following attributes are exported: * OLTP - indicates an Autonomous Transaction Processing database * DW - indicates an Autonomous Data Warehouse database * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `details` - A URL that points to a detailed description of the preview version. * `time_preview_begin` - The date and time when the preview version availability begins. * `time_preview_end` - The date and time when the preview version availability ends. diff --git a/website/docs/d/database_autonomous_db_versions.html.markdown b/website/docs/d/database_autonomous_db_versions.html.markdown index 314cee3bd55..a80fb491c2b 100644 --- a/website/docs/d/database_autonomous_db_versions.html.markdown +++ b/website/docs/d/database_autonomous_db_versions.html.markdown @@ -46,7 +46,9 @@ The following attributes are exported: * OLTP - indicates an Autonomous Transaction Processing database * DW - indicates an Autonomous Data Warehouse database * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `details` - A URL that points to a detailed description of the Autonomous Database version. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). * `is_default_for_free` - True if this version of the Oracle Database software's default is free. diff --git a/website/docs/d/database_autonomous_vm_cluster.html.markdown b/website/docs/d/database_autonomous_vm_cluster.html.markdown index ad94d30596c..9d80d71ee96 100644 --- a/website/docs/d/database_autonomous_vm_cluster.html.markdown +++ b/website/docs/d/database_autonomous_vm_cluster.html.markdown @@ -66,7 +66,7 @@ The following attributes are exported: * `name` - Name of the month of the year. * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of nodes in the Autonomous VM Cluster. diff --git a/website/docs/d/database_autonomous_vm_clusters.html.markdown b/website/docs/d/database_autonomous_vm_clusters.html.markdown index 2669ea0e9f0..b84e2516f9a 100644 --- a/website/docs/d/database_autonomous_vm_clusters.html.markdown +++ b/website/docs/d/database_autonomous_vm_clusters.html.markdown @@ -80,7 +80,7 @@ The following attributes are exported: * `name` - Name of the month of the year. * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of nodes in the Autonomous VM Cluster. diff --git a/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown b/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown index a3f5b95bad8..1189215cff8 100644 --- a/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown +++ b/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown @@ -47,6 +47,7 @@ The following attributes are exported: * `data_storage_size_in_gb` - The total data storage allocated, in gigabytes (GB). * `data_storage_size_in_tbs` - The total data storage allocated, in terabytes (TB). * `db_node_storage_size_in_gbs` - The local node storage allocated in GBs. +* `db_servers` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Db servers. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `description` - User defined description of the cloud Autonomous VM cluster. * `display_name` - The user-friendly name for the cloud Autonomous VM cluster. The name does not need to be unique. @@ -57,7 +58,9 @@ The following attributes are exported: * `is_mtls_enabled_vm_cluster` - Enable mutual TLS(mTLS) authentication for database at time of provisioning a VMCluster. This is applicable to database TLS Certificates only. Default is TLS * `last_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance run. * `last_update_history_entry_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance update history. This value is updated when a maintenance update starts. -* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. +* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_window` - The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window. * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). @@ -75,7 +78,7 @@ The following attributes are exported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of database servers in the cloud VM cluster. diff --git a/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown b/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown index 6ac1df089ec..b97b5577d1a 100644 --- a/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown +++ b/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown @@ -63,6 +63,7 @@ The following attributes are exported: * `data_storage_size_in_gb` - The total data storage allocated, in gigabytes (GB). * `data_storage_size_in_tbs` - The total data storage allocated, in terabytes (TB). * `db_node_storage_size_in_gbs` - The local node storage allocated in GBs. +* `db_servers` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Db servers. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `description` - User defined description of the cloud Autonomous VM cluster. * `display_name` - The user-friendly name for the cloud Autonomous VM cluster. The name does not need to be unique. @@ -73,7 +74,9 @@ The following attributes are exported: * `is_mtls_enabled_vm_cluster` - Enable mutual TLS(mTLS) authentication for database at time of provisioning a VMCluster. This is applicable to database TLS Certificates only. Default is TLS * `last_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance run. * `last_update_history_entry_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance update history. This value is updated when a maintenance update starts. -* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. +* `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_window` - The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window. * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). @@ -91,7 +94,7 @@ The following attributes are exported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of database servers in the cloud VM cluster. diff --git a/website/docs/d/database_cloud_exadata_infrastructure_un_allocated_resource.html.markdown b/website/docs/d/database_cloud_exadata_infrastructure_un_allocated_resource.html.markdown index 212f1f782ab..057e568a2b4 100644 --- a/website/docs/d/database_cloud_exadata_infrastructure_un_allocated_resource.html.markdown +++ b/website/docs/d/database_cloud_exadata_infrastructure_un_allocated_resource.html.markdown @@ -19,6 +19,9 @@ Gets unallocated resources information for the specified Cloud Exadata infrastru data "oci_database_cloud_exadata_infrastructure_un_allocated_resource" "test_cloud_exadata_infrastructure_un_allocated_resource" { #Required cloud_exadata_infrastructure_id = oci_database_cloud_exadata_infrastructure.test_cloud_exadata_infrastructure.id + + #Optional + db_servers = var.cloud_exadata_infrastructure_un_allocated_resource_db_servers } ``` @@ -27,6 +30,7 @@ data "oci_database_cloud_exadata_infrastructure_un_allocated_resource" "test_clo The following arguments are supported: * `cloud_exadata_infrastructure_id` - (Required) The cloud Exadata infrastructure [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `db_servers` - (Optional) The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Db servers. ## Attributes Reference diff --git a/website/docs/d/database_database_upgrade_history_entries.html.markdown b/website/docs/d/database_database_upgrade_history_entries.html.markdown index b3c43142f5e..ca0ffb8d8b9 100644 --- a/website/docs/d/database_database_upgrade_history_entries.html.markdown +++ b/website/docs/d/database_database_upgrade_history_entries.html.markdown @@ -54,7 +54,9 @@ The following attributes are exported: * Use `DB_SOFTWARE_IMAGE` to specify a [database software image](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databasesoftwareimage.htm) to upgrade the database. * `source_db_home_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. * `state` - Status of database upgrade history SUCCEEDED|IN_PROGRESS|FAILED. -* `target_db_version` - A valid Oracle Database version. To get a list of supported versions, use the [ListDbVersions](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/DbVersionSummary/ListDbVersions) operation. +* `target_db_version` - A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `target_database_software_image_id` - the database software image used for upgrading database. * `target_db_home_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. * `time_ended` - The date and time when the database upgrade ended. diff --git a/website/docs/d/database_database_upgrade_history_entry.html.markdown b/website/docs/d/database_database_upgrade_history_entry.html.markdown index e2e48c96aad..854af1d03cf 100644 --- a/website/docs/d/database_database_upgrade_history_entry.html.markdown +++ b/website/docs/d/database_database_upgrade_history_entry.html.markdown @@ -44,7 +44,9 @@ The following attributes are exported: * Use `DB_SOFTWARE_IMAGE` to specify a [database software image](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databasesoftwareimage.htm) to upgrade the database. * `source_db_home_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. * `state` - Status of database upgrade history SUCCEEDED|IN_PROGRESS|FAILED. -* `target_db_version` - A valid Oracle Database version. To get a list of supported versions, use the [ListDbVersions](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/DbVersionSummary/ListDbVersions) operation. +* `target_db_version` - A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `target_database_software_image_id` - the database software image used for upgrading database. * `target_db_home_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. * `time_ended` - The date and time when the database upgrade ended. diff --git a/website/docs/d/database_exadata_infrastructure_un_allocated_resource.html.markdown b/website/docs/d/database_exadata_infrastructure_un_allocated_resource.html.markdown new file mode 100644 index 00000000000..1fff103594f --- /dev/null +++ b/website/docs/d/database_exadata_infrastructure_un_allocated_resource.html.markdown @@ -0,0 +1,49 @@ +--- +subcategory: "Database" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_database_exadata_infrastructure_un_allocated_resource" +sidebar_current: "docs-oci-datasource-database-exadata_infrastructure_un_allocated_resource" +description: |- + Provides details about a specific Exadata Infrastructure Un Allocated Resource in Oracle Cloud Infrastructure Database service +--- + +# Data Source: oci_database_exadata_infrastructure_un_allocated_resource +This data source provides details about a specific Exadata Infrastructure Un Allocated Resource resource in Oracle Cloud Infrastructure Database service. + +Gets un allocated resources information for the specified Exadata infrastructure. Applies to Exadata Cloud@Customer instances only. + + +## Example Usage + +```hcl +data "oci_database_exadata_infrastructure_un_allocated_resource" "test_exadata_infrastructure_un_allocated_resource" { + #Required + exadata_infrastructure_id = oci_database_exadata_infrastructure.test_exadata_infrastructure.id + + #Optional + db_servers = var.exadata_infrastructure_un_allocated_resource_db_servers +} +``` + +## Argument Reference + +The following arguments are supported: + +* `db_servers` - (Optional) The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Db servers. +* `exadata_infrastructure_id` - (Required) The Exadata infrastructure [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + + +## Attributes Reference + +The following attributes are exported: + +* `autonomous_vm_clusters` - The list of Autonomous VM Clusters on the Infra and their associated unallocated resources details + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. + * `un_allocated_adb_storage_in_tbs` - Total unallocated autonomous data storage in the AVM in TBs. +* `display_name` - The user-friendly name for the Exadata Cloud@Customer infrastructure. The name does not need to be unique. +* `exadata_storage_in_tbs` - Total unallocated exadata storage in the infrastructure in TBs. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. +* `local_storage_in_gbs` - The minimum amount of un allocated storage that is available across all nodes in the infrastructure. +* `memory_in_gbs` - The minimum amount of un allocated memory that is available across all nodes in the infrastructure. +* `ocpus` - The minimum amount of un allocated ocpus that is available across all nodes in the infrastructure. + diff --git a/website/docs/r/database_autonomous_container_database.html.markdown b/website/docs/r/database_autonomous_container_database.html.markdown index 0513c4f28e1..003507071fb 100644 --- a/website/docs/r/database_autonomous_container_database.html.markdown +++ b/website/docs/r/database_autonomous_container_database.html.markdown @@ -118,7 +118,7 @@ The following arguments are supported: * `vpc_user` - (Optional) (Updatable) For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `recovery_window_in_days` - (Optional) (Updatable) Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. * `compartment_id` - (Optional) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the Autonomous Container Database. -* `db_name` - (Optional) The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. +* `db_name` - (Optional) The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_unique_name` - (Optional) **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. * `db_version` - (Optional) The base version for the Autonomous Container Database. * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -195,7 +195,7 @@ The following attributes are exported: * `recovery_window_in_days` - Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. * `compartment_id` - The OCID of the compartment. * `compute_model` - The compute model of the Autonomous VM Cluster. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. -* `db_name` - The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. +* `db_name` - The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_unique_name` - **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. * `db_version` - Oracle Database version of the Autonomous Container Database. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/website/docs/r/database_autonomous_database.html.markdown b/website/docs/r/database_autonomous_database.html.markdown index 53d8ab18d31..0029d259683 100644 --- a/website/docs/r/database_autonomous_database.html.markdown +++ b/website/docs/r/database_autonomous_database.html.markdown @@ -134,15 +134,22 @@ The following arguments are supported: * OLTP - indicates an Autonomous Transaction Processing database * DW - indicates an Autonomous Data Warehouse database * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. *Note: `db_workload` can only be updated from AJD to OLTP or from a free OLTP to AJD. -* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. *Note: `db_workload` can only be updated from AJD to OLTP or from a free OLTP to AJD. +* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `display_name` - (Optional) (Updatable) The user-friendly name for the Autonomous Database. The name does not have to be unique. * `freeform_tags` - (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `is_access_control_enabled` - (Optional) (Updatable) Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. -* `is_auto_scaling_enabled` - (Optional) (Updatable) Indicates if auto scaling is enabled for the Autonomous Database OCPU core count. The default value is `FALSE`. -* `is_data_guard_enabled` - (Optional) (Updatable) **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. + This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. +* `is_auto_scaling_enabled` - (Optional) (Updatable) Indicates if auto scaling is enabled for the Autonomous Database OCPU core count. The default value is `FALSE`. +* `is_auto_scaling_for_storage_enabled` - (Optional) (Updatable) Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. +* `is_data_guard_enabled` - (Optional) (Updatable) **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. +* `is_dedicated` - (Optional) True if the database is on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). +* `is_free_tier` - (Optional) (Updatable) Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled When `db_workload` is `AJD` it cannot be `true`. * `is_local_data_guard_enabled` - (Optional) (Updatable) Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_auto_scaling_for_storage_enabled` - (Optional) (Updatable) Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. * `is_dedicated` - (Optional) True if the database is on [dedicated Exadata infrastructure](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/adbddoverview.htm). @@ -150,8 +157,11 @@ The following arguments are supported: * `is_mtls_connection_required` - (Optional) (Updatable) Indicates whether the Autonomous Database requires mTLS connections. * `is_preview_version_with_service_terms_accepted` - (Optional) If set to `TRUE`, indicates that an Autonomous Database preview version is being provisioned, and that the preview version's terms of service have been accepted. Note that preview version software is only available for databases on [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). * `kms_key_id` - (Optional) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. -* `max_cpu_core_count` - (Optional) (Updatable) The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. -* `ncharacter_set` - (Optional) The character set for the Autonomous Database. The default is AL32UTF8. Use [List Autonomous Database Character Sets](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/autonomousDatabaseCharacterSets/ListAutonomousDatabaseCharacterSets) to list the allowed values for an Autonomous Database on shared Exadata infrastructure. For an Autonomous Database on dedicated Exadata infrastructure, the allowed values are: AL16UTF16 or UTF8. +* `license_model` - (Optional) (Updatable) The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. It is a required field when `db_workload` is AJD and needs to be set to `LICENSE_INCLUDED` as AJD does not support default `license_model` value `BRING_YOUR_OWN_LICENSE`. +* `max_cpu_core_count` - (Optional) (Updatable) The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. +* `ncharacter_set` - (Optional) The character set for the Autonomous Database. The default is AL32UTF8. Use [List Autonomous Database Character Sets](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/autonomousDatabaseCharacterSets/ListAutonomousDatabaseCharacterSets) to list the allowed values for an Autonomous Database on shared Exadata infrastructure. For an Autonomous Database on dedicated Exadata infrastructure, the allowed values are: AL16UTF16 or UTF8. * `nsg_ids` - (Optional) (Updatable) The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. * `is_refreshable_clone` - (Applicable when source=CLONE_TO_REFRESHABLE) (Updatable) True for creating a refreshable clone and False for detaching the clone from source Autonomous Database. Detaching is one time operation and clone becomes a regular Autonomous Database. @@ -170,7 +180,9 @@ The following arguments are supported: * `private_endpoint_label` - (Optional) (Updatable) The private endpoint label for the resource. * `refreshable_mode` - (Applicable when source=CLONE_TO_REFRESHABLE) (Updatable) The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. * `remote_disaster_recovery_type` - (Required when source=CROSS_REGION_DISASTER_RECOVERY) Indicates the cross-region disaster recovery (DR) type of the standby Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. -* `scheduled_operations` - (Optional) (Updatable) list of scheduled operations +* `scheduled_operations` - (Optional) (Updatable) The list of scheduled operations. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `day_of_week` - (Required) (Updatable) Day of the week. * `name` - (Required) (Updatable) Name of the day of the week. * `scheduled_start_time` - (Optional) (Updatable) auto start time. value must be of ISO-8601 format "HH:mm" @@ -202,7 +214,9 @@ The following arguments are supported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. To remove all whitelisted IPs, set the field to a list with an empty string `[""]`. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. To remove all whitelisted IPs, set the field to a list with an empty string `[""]`. * `switchover_to` - (Optional) It is applicable only when `is_data_guard_enabled` is true. Could be set to `PRIMARY` or `STANDBY`. Default value is `PRIMARY`. * `switchover_to_remote_peer_id` - (Optional) (Updatable) It is applicable only when `dataguard_region_type` and `role` are set, and `is_dedicated` is false. It takes the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the remote peer to switchover to. @@ -279,11 +293,13 @@ The following attributes are exported: * `db_name` - The database name. * `db_version` - A valid Oracle Database version for Autonomous Database. * `db_workload` - The Autonomous Database workload type. The following values are valid: - * OLTP - indicates an Autonomous Transaction Processing database - * DW - indicates an Autonomous Data Warehouse database - * AJD - indicates an Autonomous JSON Database - * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. -* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + * OLTP - indicates an Autonomous Transaction Processing database + * DW - indicates an Autonomous Data Warehouse database + * AJD - indicates an Autonomous JSON Database + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `disaster_recovery_region_type` - The disaster recovery (DR) region type of the Autonomous Database. For Shared Autonomous Databases, DR associations have designated primary and standby regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region. * `display_name` - The user-friendly name for the Autonomous Database. The name does not have to be unique. * `failed_data_recovery_in_seconds` - Indicates the number of seconds of data loss for a Data Guard failover. @@ -292,12 +308,14 @@ The following attributes are exported: * `infrastructure_type` - The infrastructure type this resource belongs to. * `is_access_control_enabled` - Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. -* `is_auto_scaling_enabled` - Indicates if auto scaling is enabled for the Autonomous Database CPU core count. -* `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. -* `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. -* `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). + This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. +* `is_auto_scaling_enabled` - Indicates if auto scaling is enabled for the Autonomous Database CPU core count. +* `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. +* `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. +* `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). * `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. @@ -309,7 +327,9 @@ The following attributes are exported: * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Databases on shared Exadata infrastructure. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. * `is_preview` - Indicates if the Autonomous Database version is a preview version. * `is_reconnect_clone_enabled` - Indicates if the refreshable clone can be reconnected to its source database. -* `is_refreshable_clone` - Indicates whether the Autonomous Database is a refreshable clone. +* `is_refreshable_clone` - Indicates if the Autonomous Database is a refreshable clone. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. @@ -320,14 +340,18 @@ The following attributes are exported: * `key_store_wallet_name` - The wallet name for Oracle Key Vault. * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. -* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. +* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. * `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `long_term_backup_schedule` - Details for the long-term backup schedule. * `is_disabled` - Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. * `repeat_cadence` - The frequency of the long-term backup schedule * `retention_period_in_days` - Retention period, in days, for long-term backups * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. +* `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. @@ -336,7 +360,7 @@ The following attributes are exported: * `state` - The current state of the Autonomous Database. * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU in the Autonomous VM Cluster. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each OCPU core in Autonomous VM Cluster. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** @@ -349,11 +373,15 @@ The following attributes are exported: For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. - **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. -* `open_mode` - The `DATABASE OPEN` mode. You can open the database in `READ_ONLY` or `READ_WRITE` mode. + **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. +* `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for shared Exadata infrastructure, standby databases located in the same region as the source primary database do not have OCIDs. -* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only to admin users. +* `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `private_endpoint` - The private endpoint for the resource. * `private_endpoint_ip` - The private endpoint Ip address for the resource. * `private_endpoint_label` - The private endpoint label for the resource. @@ -361,13 +389,15 @@ The following attributes are exported: * `refreshable_mode` - The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. * `refreshable_status` - The refresh status of the clone. REFRESHING indicates that the clone is currently being refreshed with data from the source Autonomous Database. * `remote_disaster_recovery_configuration` - Configurations of a Disaster Recovery. - * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. -* `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. -* `scheduled_operations` - list of scheduled operations - * `day_of_week` - Day of the week. - * `name` - Name of the day of the week. - * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" - * `scheduled_stop_time` - auto stop time. value must be of ISO-8601 format "HH:mm" + * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. +* `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. +* `scheduled_operations` - The list of scheduled operations. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + * `day_of_week` - Day of the week. + * `name` - Name of the day of the week. + * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" + * `scheduled_stop_time` - auto stop time. value must be of ISO-8601 format "HH:mm" * `service_console_url` - The URL of the Service Console for the Autonomous Database. * `source_id` - (Required when source=CLONE_TO_REFRESHABLE | CROSS_REGION_DATAGUARD | DATABASE | CROSS_REGION_DISASTER_RECOVERY) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source Autonomous Database that will be used to create a new standby database for the Data Guard association. * `standby_db` - **Deprecated** Autonomous Data Guard standby database details. @@ -380,7 +410,9 @@ The following attributes are exported: For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. @@ -412,7 +444,11 @@ The following attributes are exported: * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). * `whitelisted_ips` - The client IP access control list (ACL). This feature is available for autonomous databases on [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. - For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. ## Timeouts diff --git a/website/docs/r/database_autonomous_vm_cluster.html.markdown b/website/docs/r/database_autonomous_vm_cluster.html.markdown index 974006485f9..7609b8b24df 100644 --- a/website/docs/r/database_autonomous_vm_cluster.html.markdown +++ b/website/docs/r/database_autonomous_vm_cluster.html.markdown @@ -89,7 +89,7 @@ The following arguments are supported: * `preference` - (Optional) (Updatable) The maintenance window scheduling preference. * `weeks_of_month` - (Optional) (Updatable) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - (Optional) The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - (Optional) The amount of memory (in GBs) to be enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `scan_listener_port_non_tls` - (Optional) The SCAN Listener Non TLS port number. Default value is 1521. * `scan_listener_port_tls` - (Optional) The SCAN Listener TLS port number. Default value is 2484. * `time_zone` - (Optional) 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). @@ -136,7 +136,7 @@ The following attributes are exported: * `name` - Name of the month of the year. * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of nodes in the Autonomous VM Cluster. diff --git a/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown b/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown index 2c863c71f99..fc41e02c76b 100644 --- a/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown +++ b/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown @@ -79,7 +79,9 @@ The following arguments are supported: * `display_name` - (Required) (Updatable) The user-friendly name for the cloud Autonomous VM cluster. The name does not need to be unique. * `freeform_tags` - (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `is_mtls_enabled_vm_cluster` - (Optional) Enable mutual TLS(mTLS) authentication for database at time of provisioning a VMCluster. This is applicable to database TLS Certificates only. Default is TLS -* `license_model` - (Optional) (Updatable) The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. +* `license_model` - (Optional) (Updatable) The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `maintenance_window_details` - (Optional) (Updatable) The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window. * `custom_action_timeout_in_mins` - (Optional) (Updatable) Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). * `days_of_week` - (Optional) (Updatable) Days during the week when maintenance should be performed. @@ -96,7 +98,7 @@ The following arguments are supported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - (Optional) (Updatable) The maintenance window scheduling preference. * `weeks_of_month` - (Optional) (Updatable) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - (Optional) The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - (Optional) The amount of memory (in GBs) to be enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `nsg_ids` - (Optional) (Updatable) The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. * `scan_listener_port_non_tls` - (Optional) The SCAN Listener Non TLS port. Default is 1521. @@ -125,7 +127,8 @@ The following attributes are exported: * `data_storage_size_in_gb` - The total data storage allocated, in gigabytes (GB). * `data_storage_size_in_tbs` - The total data storage allocated, in terabytes (TB). * `db_node_storage_size_in_gbs` - The local node storage allocated in GBs. -* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). +* `db_servers` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Db servers. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `description` - User defined description of the cloud Autonomous VM cluster. * `display_name` - The user-friendly name for the cloud Autonomous VM cluster. The name does not need to be unique. * `domain` - The domain name for the cloud Autonomous VM cluster. @@ -136,6 +139,8 @@ The following attributes are exported: * `last_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance run. * `last_update_history_entry_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance update history. This value is updated when a maintenance update starts. * `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle PaaS and IaaS services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Database service. Note that when provisioning an Autonomous Database on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null because the attribute is already set at the Autonomous Exadata Infrastructure level. When using [shared Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), if a value is not specified, the system will supply the value of `BRING_YOUR_OWN_LICENSE`. + + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_window` - The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window. * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). @@ -153,7 +158,7 @@ The following attributes are exported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per each CPU core. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of database servers in the cloud VM cluster. diff --git a/website/docs/r/database_database.html.markdown b/website/docs/r/database_database.html.markdown index 2c2256b9cd3..8b4c8e2740b 100644 --- a/website/docs/r/database_database.html.markdown +++ b/website/docs/r/database_database.html.markdown @@ -110,7 +110,9 @@ The following arguments are supported: * `tde_wallet_password` - (Applicable when source=NONE) The optional password to open the TDE wallet. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, \#, or -. * `vault_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). * `db_home_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. -* `db_version` - (Optional) A valid Oracle Database version. To get a list of supported versions, use the [ListDbVersions](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/DbVersionSummary/ListDbVersions) operation. +* `db_version` - (Optional) A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `kms_key_id` - (Optional) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_migration` - (Optional) The value to migrate to the kms version from none. Can only use once by setting value to true. You can not switch back to non-kms once you created or migrated.(https://www.oracle.com/security/cloud-security/key-management/faq/) * `kms_key_rotation` - (Optional) The value to rotate the key version of current kms_key. Just change this value will trigger the rotation. diff --git a/website/docs/r/database_database_upgrade.html.markdown b/website/docs/r/database_database_upgrade.html.markdown index abeae73a39c..d9a1180d9eb 100644 --- a/website/docs/r/database_database_upgrade.html.markdown +++ b/website/docs/r/database_database_upgrade.html.markdown @@ -53,7 +53,9 @@ The following arguments are supported: * `database_upgrade_source_details` - (Optional) Details for the database upgrade source. * `database_software_image_id` - (Required when source=DB_SOFTWARE_IMAGE) The database software image [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image to be used to upgrade a database. * `db_home_id` - (Required when source=DB_HOME) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. - * `db_version` - (Required when source=DB_VERSION) A valid Oracle Database version. To get a list of supported versions, use the [ListDbVersions](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/DbVersionSummary/ListDbVersions) operation. + * `db_version` - (Required when source=DB_VERSION) A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `options` - (Optional) Additional upgrade options supported by DBUA(Database Upgrade Assistant). Example: "-upgradeTimezone false -keepEvents" * `source` - (Optional) The source of the Oracle Database software to be used for the upgrade. * Use `DB_VERSION` to specify a generally-available Oracle Database software version to upgrade the database. diff --git a/website/docs/r/database_db_system.html.markdown b/website/docs/r/database_db_system.html.markdown index 2f7eb541500..0543dc86c34 100644 --- a/website/docs/r/database_db_system.html.markdown +++ b/website/docs/r/database_db_system.html.markdown @@ -223,7 +223,9 @@ The following arguments are supported: * `time_stamp_for_point_in_time_recovery` - (Applicable when source=DATABASE) The point in time of the original database from which the new database is created. If not specifed, the latest backup is used to create the database. * `vault_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). * `database_software_image_id` - (Applicable when source=DB_BACKUP | NONE) The database software image [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image to be used to restore a database. - * `db_version` - (Required when source=NONE) A valid Oracle Database version. To get a list of supported versions, use the [ListDbVersions](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/DbVersionSummary/ListDbVersions) operation. + * `db_version` - (Required when source=NONE) A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `defined_tags` - (Optional) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `display_name` - (Optional) The user-provided name of the Database Home. * `freeform_tags` - (Optional) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` diff --git a/website/docs/r/database_pluggable_databases_remote_clone.html.markdown b/website/docs/r/database_pluggable_databases_remote_clone.html.markdown index a6a567a6a2b..8863dfd7a48 100644 --- a/website/docs/r/database_pluggable_databases_remote_clone.html.markdown +++ b/website/docs/r/database_pluggable_databases_remote_clone.html.markdown @@ -11,7 +11,7 @@ description: |- This resource provides the Pluggable Databases Remote Clone resource in Oracle Cloud Infrastructure Database service. Clones a pluggable database (PDB) to a different database from the source PDB. The cloned PDB will be started upon completion of the clone operation. The source PDB must be in the `READ_WRITE` openMode when performing the clone. -For Exadata Cloud@Customer instances, the source pluggable database (PDB) must be on the same Exadata Infrastructure as the target container database (CDB) to create a remote clone. +For Exadata Cloud@Customer instances, the source pluggable database (PDB) must be on the same Exadata Infrastructure as the target container database (CDB) to create a remote clone. ## Example Usage From 0951ce89f73a56d7351fed40d718ab1d17d192c6 Mon Sep 17 00:00:00 2001 From: Kaihua Shi Date: Thu, 20 Apr 2023 16:31:07 -0700 Subject: [PATCH 08/16] Added - ExaDB-C@C (EXACC) Data Plane Guest VMs (API/UI Only) --- .../database_exadata_infrastructure_test.go | 2 ++ internal/integrationtest/database_vm_cluster_test.go | 2 ++ .../database_exadata_infrastructure_data_source.go | 4 ++++ .../database/database_exadata_infrastructure_resource.go | 8 ++++++++ .../database_exadata_infrastructures_data_source.go | 4 ++++ .../database_vm_cluster_add_virtual_machine_resource.go | 8 ++++++++ .../service/database/database_vm_cluster_data_source.go | 4 ++++ ...database_vm_cluster_remove_virtual_machine_resource.go | 8 ++++++++ internal/service/database/database_vm_cluster_resource.go | 8 ++++++++ .../service/database/database_vm_clusters_data_source.go | 4 ++++ .../docs/d/database_exadata_infrastructure.html.markdown | 1 + .../docs/d/database_exadata_infrastructures.html.markdown | 1 + website/docs/d/database_vm_cluster.html.markdown | 1 + website/docs/d/database_vm_clusters.html.markdown | 1 + .../database_autonomous_container_database.html.markdown | 4 ++-- .../docs/r/database_exadata_infrastructure.html.markdown | 1 + website/docs/r/database_vm_cluster.html.markdown | 1 + .../database_vm_cluster_add_virtual_machine.html.markdown | 1 + ...tabase_vm_cluster_remove_virtual_machine.html.markdown | 1 + 19 files changed, 62 insertions(+), 2 deletions(-) diff --git a/internal/integrationtest/database_exadata_infrastructure_test.go b/internal/integrationtest/database_exadata_infrastructure_test.go index edf976880b0..2583df7c2b9 100644 --- a/internal/integrationtest/database_exadata_infrastructure_test.go +++ b/internal/integrationtest/database_exadata_infrastructure_test.go @@ -420,6 +420,7 @@ func TestDatabaseExadataInfrastructureResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "exadata_infrastructures.0.additional_compute_count"), resource.TestCheckResourceAttrSet(datasourceName, "exadata_infrastructures.0.additional_storage_count"), resource.TestCheckResourceAttr(datasourceName, "exadata_infrastructures.0.admin_network_cidr", "192.168.0.0/20"), + resource.TestCheckResourceAttrSet(datasourceName, "exadata_infrastructures.0.availability_domain"), resource.TestCheckResourceAttr(datasourceName, "exadata_infrastructures.0.cloud_control_plane_server1", "10.32.88.2"), resource.TestCheckResourceAttr(datasourceName, "exadata_infrastructures.0.cloud_control_plane_server2", "10.32.88.4"), resource.TestCheckResourceAttr(datasourceName, "exadata_infrastructures.0.compartment_id", compartmentId), @@ -488,6 +489,7 @@ func TestDatabaseExadataInfrastructureResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "additional_compute_count"), resource.TestCheckResourceAttrSet(singularDatasourceName, "additional_storage_count"), resource.TestCheckResourceAttr(singularDatasourceName, "admin_network_cidr", "192.168.0.0/20"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "availability_domain"), resource.TestCheckResourceAttr(singularDatasourceName, "cloud_control_plane_server1", "10.32.88.2"), resource.TestCheckResourceAttr(singularDatasourceName, "cloud_control_plane_server2", "10.32.88.4"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), diff --git a/internal/integrationtest/database_vm_cluster_test.go b/internal/integrationtest/database_vm_cluster_test.go index 3896d995fa3..ef24f387a31 100644 --- a/internal/integrationtest/database_vm_cluster_test.go +++ b/internal/integrationtest/database_vm_cluster_test.go @@ -243,6 +243,7 @@ func TestDatabaseVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"), resource.TestCheckResourceAttr(datasourceName, "vm_clusters.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "vm_clusters.0.availability_domain"), resource.TestCheckResourceAttr(datasourceName, "vm_clusters.0.compartment_id", compartmentId), resource.TestCheckResourceAttrSet(datasourceName, "vm_clusters.0.cpus_enabled"), resource.TestCheckResourceAttr(datasourceName, "vm_clusters.0.data_collection_options.#", "1"), @@ -277,6 +278,7 @@ func TestDatabaseVmClusterResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "vm_cluster_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "availability_domain"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(singularDatasourceName, "cpus_enabled"), resource.TestCheckResourceAttr(singularDatasourceName, "data_collection_options.#", "1"), diff --git a/internal/service/database/database_exadata_infrastructure_data_source.go b/internal/service/database/database_exadata_infrastructure_data_source.go index 7e7fbf0c20b..e3c9c46ec26 100644 --- a/internal/service/database/database_exadata_infrastructure_data_source.go +++ b/internal/service/database/database_exadata_infrastructure_data_source.go @@ -86,6 +86,10 @@ func (s *DatabaseExadataInfrastructureDataSourceCrud) SetData() error { s.D.Set("admin_network_cidr", *s.Res.AdminNetworkCIDR) } + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.CloudControlPlaneServer1 != nil { s.D.Set("cloud_control_plane_server1", *s.Res.CloudControlPlaneServer1) } diff --git a/internal/service/database/database_exadata_infrastructure_resource.go b/internal/service/database/database_exadata_infrastructure_resource.go index 84aaf0e4548..f381c13647c 100644 --- a/internal/service/database/database_exadata_infrastructure_resource.go +++ b/internal/service/database/database_exadata_infrastructure_resource.go @@ -324,6 +324,10 @@ func DatabaseExadataInfrastructureResource() *schema.Resource { Optional: true, Computed: true, }, + "availability_domain": { + Type: schema.TypeString, + Computed: true, + }, "cpus_enabled": { Type: schema.TypeInt, Computed: true, @@ -932,6 +936,10 @@ func (s *DatabaseExadataInfrastructureResourceCrud) SetData() error { s.D.Set("admin_network_cidr", *s.Res.AdminNetworkCIDR) } + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.CloudControlPlaneServer1 != nil { s.D.Set("cloud_control_plane_server1", *s.Res.CloudControlPlaneServer1) } diff --git a/internal/service/database/database_exadata_infrastructures_data_source.go b/internal/service/database/database_exadata_infrastructures_data_source.go index 79b82ee0bf8..928c14df759 100644 --- a/internal/service/database/database_exadata_infrastructures_data_source.go +++ b/internal/service/database/database_exadata_infrastructures_data_source.go @@ -130,6 +130,10 @@ func (s *DatabaseExadataInfrastructuresDataSourceCrud) SetData() error { exadataInfrastructure["admin_network_cidr"] = *r.AdminNetworkCIDR } + if r.AvailabilityDomain != nil { + exadataInfrastructure["availability_domain"] = *r.AvailabilityDomain + } + if r.CloudControlPlaneServer1 != nil { exadataInfrastructure["cloud_control_plane_server1"] = *r.CloudControlPlaneServer1 } diff --git a/internal/service/database/database_vm_cluster_add_virtual_machine_resource.go b/internal/service/database/database_vm_cluster_add_virtual_machine_resource.go index d1f22990629..b48821bcd81 100644 --- a/internal/service/database/database_vm_cluster_add_virtual_machine_resource.go +++ b/internal/service/database/database_vm_cluster_add_virtual_machine_resource.go @@ -62,6 +62,10 @@ func DatabaseVmClusterAddVirtualMachineResource() *schema.Resource { }, // Computed + "availability_domain": { + Type: schema.TypeString, + Computed: true, + }, "compartment_id": { Type: schema.TypeString, Computed: true, @@ -272,6 +276,10 @@ func (s *DatabaseVmClusterAddVirtualMachineResourceCrud) Create() error { } func (s *DatabaseVmClusterAddVirtualMachineResourceCrud) SetData() error { + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_vm_cluster_data_source.go b/internal/service/database/database_vm_cluster_data_source.go index b19bb10be05..f131044cfa3 100644 --- a/internal/service/database/database_vm_cluster_data_source.go +++ b/internal/service/database/database_vm_cluster_data_source.go @@ -66,6 +66,10 @@ func (s *DatabaseVmClusterDataSourceCrud) SetData() error { s.D.SetId(*s.Res.Id) + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_vm_cluster_remove_virtual_machine_resource.go b/internal/service/database/database_vm_cluster_remove_virtual_machine_resource.go index 23231bc54a6..05625680bbb 100644 --- a/internal/service/database/database_vm_cluster_remove_virtual_machine_resource.go +++ b/internal/service/database/database_vm_cluster_remove_virtual_machine_resource.go @@ -54,6 +54,10 @@ func DatabaseVmClusterRemoveVirtualMachineResource() *schema.Resource { // Optional // Computed + "availability_domain": { + Type: schema.TypeString, + Computed: true, + }, "compartment_id": { Type: schema.TypeString, Computed: true, @@ -264,6 +268,10 @@ func (s *DatabaseVmClusterRemoveVirtualMachineResourceCrud) Create() error { } func (s *DatabaseVmClusterRemoveVirtualMachineResourceCrud) SetData() error { + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_vm_cluster_resource.go b/internal/service/database/database_vm_cluster_resource.go index a891387cdfb..4141f2036ea 100644 --- a/internal/service/database/database_vm_cluster_resource.go +++ b/internal/service/database/database_vm_cluster_resource.go @@ -170,6 +170,10 @@ func DatabaseVmClusterResource() *schema.Resource { }, // Computed + "availability_domain": { + Type: schema.TypeString, + Computed: true, + }, "cpus_enabled": { Type: schema.TypeInt, Computed: true, @@ -556,6 +560,10 @@ func (s *DatabaseVmClusterResourceCrud) Delete() error { } func (s *DatabaseVmClusterResourceCrud) SetData() error { + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_vm_clusters_data_source.go b/internal/service/database/database_vm_clusters_data_source.go index feb7291e831..d3ad81e6096 100644 --- a/internal/service/database/database_vm_clusters_data_source.go +++ b/internal/service/database/database_vm_clusters_data_source.go @@ -119,6 +119,10 @@ func (s *DatabaseVmClustersDataSourceCrud) SetData() error { "compartment_id": *r.CompartmentId, } + if r.AvailabilityDomain != nil { + vmCluster["availability_domain"] = *r.AvailabilityDomain + } + if r.CpusEnabled != nil { vmCluster["cpus_enabled"] = *r.CpusEnabled vmCluster["cpu_core_count"] = *r.CpusEnabled diff --git a/website/docs/d/database_exadata_infrastructure.html.markdown b/website/docs/d/database_exadata_infrastructure.html.markdown index 9a30f8f3c5c..2b711a9a911 100644 --- a/website/docs/d/database_exadata_infrastructure.html.markdown +++ b/website/docs/d/database_exadata_infrastructure.html.markdown @@ -43,6 +43,7 @@ The following attributes are exported: * `additional_compute_system_model` - Oracle Exadata System Model specification. The system model determines the amount of compute or storage server resources available for use. For more information, please see [System and Shape Configuration Options] (https://docs.oracle.com/en/engineered-systems/exadata-cloud-at-customer/ecccm/ecc-system-config-options.html#GUID-9E090174-5C57-4EB1-9243-B470F9F10D6B) * `additional_storage_count` - The requested number of additional storage servers for the Exadata infrastructure. * `admin_network_cidr` - The CIDR block for the Exadata administration network. +* `availability_domain` - The name of the availability domain that the Exadata infrastructure is located in. * `cloud_control_plane_server1` - The IP address for the first control plane server. * `cloud_control_plane_server2` - The IP address for the second control plane server. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. diff --git a/website/docs/d/database_exadata_infrastructures.html.markdown b/website/docs/d/database_exadata_infrastructures.html.markdown index a98e377d88b..84bb23bd16f 100644 --- a/website/docs/d/database_exadata_infrastructures.html.markdown +++ b/website/docs/d/database_exadata_infrastructures.html.markdown @@ -53,6 +53,7 @@ The following attributes are exported: * `additional_compute_system_model` - Oracle Exadata System Model specification. The system model determines the amount of compute or storage server resources available for use. For more information, please see [System and Shape Configuration Options] (https://docs.oracle.com/en/engineered-systems/exadata-cloud-at-customer/ecccm/ecc-system-config-options.html#GUID-9E090174-5C57-4EB1-9243-B470F9F10D6B) * `additional_storage_count` - The requested number of additional storage servers for the Exadata infrastructure. * `admin_network_cidr` - The CIDR block for the Exadata administration network. +* `availability_domain` - The name of the availability domain that the Exadata infrastructure is located in. * `cloud_control_plane_server1` - The IP address for the first control plane server. * `cloud_control_plane_server2` - The IP address for the second control plane server. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. diff --git a/website/docs/d/database_vm_cluster.html.markdown b/website/docs/d/database_vm_cluster.html.markdown index 86ea310ac8b..09ef8168075 100644 --- a/website/docs/d/database_vm_cluster.html.markdown +++ b/website/docs/d/database_vm_cluster.html.markdown @@ -33,6 +33,7 @@ The following arguments are supported: The following attributes are exported: +* `availability_domain` - The name of the availability domain that the VM cluster is located in. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `cpus_enabled` - The number of enabled CPU cores. * `data_collection_options` - Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. diff --git a/website/docs/d/database_vm_clusters.html.markdown b/website/docs/d/database_vm_clusters.html.markdown index 10c9b205417..27c387128c7 100644 --- a/website/docs/d/database_vm_clusters.html.markdown +++ b/website/docs/d/database_vm_clusters.html.markdown @@ -48,6 +48,7 @@ The following attributes are exported: The following attributes are exported: +* `availability_domain` - The name of the availability domain that the VM cluster is located in. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `cpus_enabled` - The number of enabled CPU cores. * `data_collection_options` - Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. diff --git a/website/docs/r/database_autonomous_container_database.html.markdown b/website/docs/r/database_autonomous_container_database.html.markdown index 003507071fb..fe136b3d45d 100644 --- a/website/docs/r/database_autonomous_container_database.html.markdown +++ b/website/docs/r/database_autonomous_container_database.html.markdown @@ -182,8 +182,8 @@ The following attributes are exported: * `autonomous_exadata_infrastructure_id` - **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. * `autonomous_vm_cluster_id` - The OCID of the Autonomous VM Cluster. * `cloud_autonomous_vm_cluster_id` - The OCID of the Cloud Autonomous VM Cluster. -* `availability_domain` - The availability domain of the Autonomous Container Database. -* `available_cpus` - Sum of OCPUs available on the Autonomous VM Cluster + Sum of reclaimable OCPUs available in the Autonomous Container Database. +* `availability_domain` - The availability domain of the Autonomous Container Database +* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database.
For Autonomous Databases on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. * `backup_config` - Backup options for the Autonomous Container Database. * `backup_destination_details` - Backup destination details. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. diff --git a/website/docs/r/database_exadata_infrastructure.html.markdown b/website/docs/r/database_exadata_infrastructure.html.markdown index da3047c579d..b4faa33995b 100644 --- a/website/docs/r/database_exadata_infrastructure.html.markdown +++ b/website/docs/r/database_exadata_infrastructure.html.markdown @@ -145,6 +145,7 @@ The following attributes are exported: * `additional_compute_system_model` - Oracle Exadata System Model specification. The system model determines the amount of compute or storage server resources available for use. For more information, please see [System and Shape Configuration Options] (https://docs.oracle.com/en/engineered-systems/exadata-cloud-at-customer/ecccm/ecc-system-config-options.html#GUID-9E090174-5C57-4EB1-9243-B470F9F10D6B) * `additional_storage_count` - The requested number of additional storage servers for the Exadata infrastructure. * `admin_network_cidr` - The CIDR block for the Exadata administration network. +* `availability_domain` - The name of the availability domain that the Exadata infrastructure is located in. * `cloud_control_plane_server1` - The IP address for the first control plane server. * `cloud_control_plane_server2` - The IP address for the second control plane server. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. diff --git a/website/docs/r/database_vm_cluster.html.markdown b/website/docs/r/database_vm_cluster.html.markdown index 2189f3606fd..14ddcfc6131 100644 --- a/website/docs/r/database_vm_cluster.html.markdown +++ b/website/docs/r/database_vm_cluster.html.markdown @@ -82,6 +82,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `availability_domain` - The name of the availability domain that the VM cluster is located in. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `cpus_enabled` - The number of enabled CPU cores. * `data_collection_options` - Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. diff --git a/website/docs/r/database_vm_cluster_add_virtual_machine.html.markdown b/website/docs/r/database_vm_cluster_add_virtual_machine.html.markdown index de6cdf33ac4..97e37e0694f 100644 --- a/website/docs/r/database_vm_cluster_add_virtual_machine.html.markdown +++ b/website/docs/r/database_vm_cluster_add_virtual_machine.html.markdown @@ -44,6 +44,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `availability_domain` - The name of the availability domain that the VM cluster is located in. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `cpus_enabled` - The number of enabled CPU cores. * `data_collection_options` - Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. diff --git a/website/docs/r/database_vm_cluster_remove_virtual_machine.html.markdown b/website/docs/r/database_vm_cluster_remove_virtual_machine.html.markdown index a15087b145a..903e5257fe8 100644 --- a/website/docs/r/database_vm_cluster_remove_virtual_machine.html.markdown +++ b/website/docs/r/database_vm_cluster_remove_virtual_machine.html.markdown @@ -42,6 +42,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `availability_domain` - The name of the availability domain that the VM cluster is located in. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `cpus_enabled` - The number of enabled CPU cores. * `data_collection_options` - Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. From 86c6204cb820a05f7496adbf690abad0c6c11102 Mon Sep 17 00:00:00 2001 From: Aniket Limaye Date: Tue, 16 May 2023 15:12:08 -0400 Subject: [PATCH 09/16] Bug Fix - Populate user resource optional fields only if they arent empty --- examples/identity_domains/api_key.tf | 9 +- examples/identity_domains/auth_token.tf | 10 +- .../authentication_factor_settings.tf | 3 + .../identity_domains/customer_secret_key.tf | 10 +- .../dynamic_resource_group.tf | 5 +- examples/identity_domains/group.tf | 5 +- examples/identity_domains/identity_domain.tf | 9 ++ .../identity_domains/identity_provider.tf | 5 +- examples/identity_domains/kmsi_setting.tf | 2 +- examples/identity_domains/my_api_key.tf | 10 +- examples/identity_domains/my_auth_token.tf | 13 +- .../my_customer_secret_key.tf | 12 +- examples/identity_domains/my_device.tf | 2 +- examples/identity_domains/my_group.tf | 2 +- .../my_oauth2client_credential.tf | 12 +- .../identity_domains/my_smtp_credential.tf | 12 +- .../identity_domains/my_support_account.tf | 11 +- .../identity_domains/my_trusted_user_agent.tf | 2 +- .../identity_domains/my_user_db_credential.tf | 13 +- .../oauth2client_credential.tf | 9 +- examples/identity_domains/password_policy.tf | 2 +- examples/identity_domains/smtp_credential.tf | 9 +- examples/identity_domains/user.tf | 11 +- .../identity_domains/user_db_credential.tf | 11 +- .../identity_domains_user_test.go | 22 ++- .../identity_domains_user_resource.go | 133 ++++++++++++------ .../identity_domains/identity_domains_util.go | 25 ++++ 27 files changed, 294 insertions(+), 75 deletions(-) diff --git a/examples/identity_domains/api_key.tf b/examples/identity_domains/api_key.tf index 8bd79797f5f..ce86e290729 100644 --- a/examples/identity_domains/api_key.tf +++ b/examples/identity_domains/api_key.tf @@ -46,7 +46,7 @@ resource "oci_identity_domains_api_key" "test_api_key" { schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:apikey"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.api_key_authorization description = var.api_key_description @@ -68,6 +68,13 @@ resource "oci_identity_domains_api_key" "test_api_key" { #must be a user that exists value = oci_identity_domains_user.test_user.id } + + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + urnietfparamsscimschemasoracleidcsextensionself_change_user + ] + } } data "oci_identity_domains_api_keys" "test_api_keys" { diff --git a/examples/identity_domains/auth_token.tf b/examples/identity_domains/auth_token.tf index 9d5a22a65c1..50c25957dbf 100644 --- a/examples/identity_domains/auth_token.tf +++ b/examples/identity_domains/auth_token.tf @@ -44,7 +44,7 @@ resource "oci_identity_domains_auth_token" "test_auth_token" { schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:authToken"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.auth_token_authorization description = var.auth_token_description @@ -70,6 +70,14 @@ resource "oci_identity_domains_auth_token" "test_auth_token" { #must be a user that exists value = oci_identity_domains_user.test_user.id } + + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + status, + urnietfparamsscimschemasoracleidcsextensionself_change_user + ] + } } data "oci_identity_domains_auth_tokens" "test_auth_tokens" { diff --git a/examples/identity_domains/authentication_factor_settings.tf b/examples/identity_domains/authentication_factor_settings.tf index 9c8aa28367e..463bd30fe10 100644 --- a/examples/identity_domains/authentication_factor_settings.tf +++ b/examples/identity_domains/authentication_factor_settings.tf @@ -477,6 +477,9 @@ resource "oci_identity_domains_authentication_factor_setting" "test_authenticati } user_enrollment_disabled_factors = var.authentication_factor_setting_user_enrollment_disabled_factors yubico_otp_enabled = var.authentication_factor_setting_yubico_otp_enabled + lifecycle { + ignore_changes = [schemas] + } } data "oci_identity_domains_authentication_factor_settings" "test_authentication_factor_settings" { diff --git a/examples/identity_domains/customer_secret_key.tf b/examples/identity_domains/customer_secret_key.tf index 3be22d2078d..1797d4c605e 100644 --- a/examples/identity_domains/customer_secret_key.tf +++ b/examples/identity_domains/customer_secret_key.tf @@ -48,7 +48,7 @@ resource "oci_identity_domains_customer_secret_key" "test_customer_secret_key" { schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:customerSecretKey"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.customer_secret_key_authorization description = var.customer_secret_key_description @@ -75,6 +75,14 @@ resource "oci_identity_domains_customer_secret_key" "test_customer_secret_key" { #must be a user that exists value = oci_identity_domains_user.test_user.id } + + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + status, + urnietfparamsscimschemasoracleidcsextensionself_change_user + ] + } } data "oci_identity_domains_customer_secret_keys" "test_customer_secret_keys" { diff --git a/examples/identity_domains/dynamic_resource_group.tf b/examples/identity_domains/dynamic_resource_group.tf index 44945ace7c8..5ec77f1056c 100644 --- a/examples/identity_domains/dynamic_resource_group.tf +++ b/examples/identity_domains/dynamic_resource_group.tf @@ -66,7 +66,7 @@ resource "oci_identity_domains_dynamic_resource_group" "test_dynamic_resource_gr schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:DynamicResourceGroup"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.dynamic_resource_group_authorization description = var.dynamic_resource_group_description @@ -94,6 +94,9 @@ resource "oci_identity_domains_dynamic_resource_group" "test_dynamic_resource_gr value = var.dynamic_resource_group_urnietfparamsscimschemasoracleidcsextension_oci_tags_freeform_tags_value } } + lifecycle { + ignore_changes = [schemas] + } } data "oci_identity_domains_dynamic_resource_groups" "test_dynamic_resource_groups" { diff --git a/examples/identity_domains/group.tf b/examples/identity_domains/group.tf index 13bd251a4e4..1a2f43169c9 100644 --- a/examples/identity_domains/group.tf +++ b/examples/identity_domains/group.tf @@ -129,7 +129,7 @@ resource "oci_identity_domains_group" "test_group" { schemas = ["urn:ietf:params:scim:schemas:core:2.0:Group"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.group_authorization external_id = "externalId" @@ -196,6 +196,9 @@ resource "oci_identity_domains_group" "test_group" { #Optional requestable = var.group_urnietfparamsscimschemasoracleidcsextensionrequestable_group_requestable } + lifecycle { + ignore_changes = [schemas] + } } data "oci_identity_domains_groups" "test_groups" { diff --git a/examples/identity_domains/identity_domain.tf b/examples/identity_domains/identity_domain.tf index 234f0d0d37f..c3a0f41bb2b 100644 --- a/examples/identity_domains/identity_domain.tf +++ b/examples/identity_domains/identity_domain.tf @@ -6,3 +6,12 @@ variable "identity_domain_id" { data "oci_identity_domain" "test_domain" { domain_id = var.identity_domain_id } + + +variable "identity_domain_id_for_my_endpoint" { + default = "" +} + +data "oci_identity_domain" "test_domain_for_my_endpoint" { + domain_id = var.identity_domain_id_for_my_endpoint +} \ No newline at end of file diff --git a/examples/identity_domains/identity_provider.tf b/examples/identity_domains/identity_provider.tf index 47bc4ac97f3..7bfe3d4cfe7 100644 --- a/examples/identity_domains/identity_provider.tf +++ b/examples/identity_domains/identity_provider.tf @@ -335,7 +335,7 @@ resource "oci_identity_domains_identity_provider" "test_identity_provider" { #Optional assertion_attribute = var.identity_provider_assertion_attribute - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authn_request_binding = var.identity_provider_authn_request_binding authorization = var.identity_provider_authorization @@ -447,6 +447,9 @@ resource "oci_identity_domains_identity_provider" "test_identity_provider" { } user_mapping_method = var.identity_provider_user_mapping_method user_mapping_store_attribute = var.identity_provider_user_mapping_store_attribute + lifecycle { + ignore_changes = [schemas] + } } data "oci_identity_domains_identity_providers" "test_identity_providers" { diff --git a/examples/identity_domains/kmsi_setting.tf b/examples/identity_domains/kmsi_setting.tf index d8aa31ff5eb..79877641333 100644 --- a/examples/identity_domains/kmsi_setting.tf +++ b/examples/identity_domains/kmsi_setting.tf @@ -57,7 +57,7 @@ resource "oci_identity_domains_kmsi_setting" "test_kmsi_setting" { schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:KmsiSettings"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.kmsi_setting_authorization external_id = "externalId" diff --git a/examples/identity_domains/my_api_key.tf b/examples/identity_domains/my_api_key.tf index c1fdcd98697..3b7ab60556b 100644 --- a/examples/identity_domains/my_api_key.tf +++ b/examples/identity_domains/my_api_key.tf @@ -49,7 +49,7 @@ variable "my_api_key_user_value" { resource "oci_identity_domains_my_api_key" "test_my_api_key" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url key = var.my_api_key_key schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:apikey"] @@ -73,11 +73,17 @@ resource "oci_identity_domains_my_api_key" "test_my_api_key" { } */ + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + tags + ] + } } data "oci_identity_domains_my_api_keys" "test_my_api_keys" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_api_key_count = var.my_api_key_my_api_key_count diff --git a/examples/identity_domains/my_auth_token.tf b/examples/identity_domains/my_auth_token.tf index 850b1544816..81b315293db 100644 --- a/examples/identity_domains/my_auth_token.tf +++ b/examples/identity_domains/my_auth_token.tf @@ -48,7 +48,7 @@ variable "my_auth_token_user_value" { resource "oci_identity_domains_my_auth_token" "test_my_auth_token" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:authToken"] #Optional @@ -72,11 +72,20 @@ resource "oci_identity_domains_my_auth_token" "test_my_auth_token" { value = var.my_auth_token_user_value } */ + + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + // my* resource will not return non-default fields + tags, + status + ] + } } data "oci_identity_domains_my_auth_tokens" "test_my_auth_tokens" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_auth_token_count = var.my_auth_token_my_auth_token_count diff --git a/examples/identity_domains/my_customer_secret_key.tf b/examples/identity_domains/my_customer_secret_key.tf index 1d9ca7e6c8a..9ba0c34caea 100644 --- a/examples/identity_domains/my_customer_secret_key.tf +++ b/examples/identity_domains/my_customer_secret_key.tf @@ -56,7 +56,7 @@ variable "my_customer_secret_key_user_value" { resource "oci_identity_domains_my_customer_secret_key" "test_my_customer_secret_key" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:customerSecretKey"] #Optional @@ -80,11 +80,19 @@ resource "oci_identity_domains_my_customer_secret_key" "test_my_customer_secret_ value = var.my_customer_secret_key_user_value } */ + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + // my* resource will not return non-default fields + tags, + status + ] + } } data "oci_identity_domains_my_customer_secret_keys" "test_my_customer_secret_keys" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_customer_secret_key_count = var.my_customer_secret_key_my_customer_secret_key_count diff --git a/examples/identity_domains/my_device.tf b/examples/identity_domains/my_device.tf index d1beae136a4..46721d18ef7 100644 --- a/examples/identity_domains/my_device.tf +++ b/examples/identity_domains/my_device.tf @@ -20,7 +20,7 @@ variable "my_device_start_index" { data "oci_identity_domains_my_devices" "test_my_devices" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_device_count = var.my_device_my_device_count diff --git a/examples/identity_domains/my_group.tf b/examples/identity_domains/my_group.tf index a865400bf82..9d8282db8d3 100644 --- a/examples/identity_domains/my_group.tf +++ b/examples/identity_domains/my_group.tf @@ -20,7 +20,7 @@ variable "my_group_start_index" { data "oci_identity_domains_my_groups" "test_my_groups" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_group_count = var.my_group_my_group_count diff --git a/examples/identity_domains/my_oauth2client_credential.tf b/examples/identity_domains/my_oauth2client_credential.tf index e0e58b124f8..6e3edc5d4af 100644 --- a/examples/identity_domains/my_oauth2client_credential.tf +++ b/examples/identity_domains/my_oauth2client_credential.tf @@ -64,7 +64,7 @@ variable "my_oauth2client_credential_user_value" { resource "oci_identity_domains_my_oauth2client_credential" "test_my_oauth2client_credential" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url name = var.my_oauth2client_credential_name schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:oauth2ClientCredential"] scopes { @@ -94,11 +94,19 @@ resource "oci_identity_domains_my_oauth2client_credential" "test_my_oauth2client value = var.my_oauth2client_credential_user_value } */ + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + // my* resource will not return non-default fields + tags, + status + ] + } } data "oci_identity_domains_my_oauth2client_credentials" "test_my_oauth2client_credentials" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_oauth2client_credential_count = var.my_oauth2client_credential_my_oauth2client_credential_count diff --git a/examples/identity_domains/my_smtp_credential.tf b/examples/identity_domains/my_smtp_credential.tf index 5d7c8c0626c..5e8d32df3de 100644 --- a/examples/identity_domains/my_smtp_credential.tf +++ b/examples/identity_domains/my_smtp_credential.tf @@ -48,7 +48,7 @@ variable "my_smtp_credential_user_value" { resource "oci_identity_domains_my_smtp_credential" "test_my_smtp_credential" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:smtpCredential"] #Optional @@ -71,11 +71,19 @@ resource "oci_identity_domains_my_smtp_credential" "test_my_smtp_credential" { value = var.my_smtp_credential_user_value } */ + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + // my* resource will not return non-default fields + tags, + status + ] + } } data "oci_identity_domains_my_smtp_credentials" "test_my_smtp_credentials" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_smtp_credential_count = var.my_smtp_credential_my_smtp_credential_count diff --git a/examples/identity_domains/my_support_account.tf b/examples/identity_domains/my_support_account.tf index 11a5ff435a8..7698c104333 100644 --- a/examples/identity_domains/my_support_account.tf +++ b/examples/identity_domains/my_support_account.tf @@ -49,7 +49,7 @@ variable "my_support_account_user_value" { resource "oci_identity_domains_my_support_account" "test_my_support_account" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:supportAccount"] token = var.my_support_account_token @@ -71,12 +71,19 @@ resource "oci_identity_domains_my_support_account" "test_my_support_account" { value = var.my_support_account_user_value } */ + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + // my* resource will not return non-default fields + tags + ] + } } data "oci_identity_domains_my_support_accounts" "test_my_support_accounts" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_support_account_count = var.my_support_account_my_support_account_count diff --git a/examples/identity_domains/my_trusted_user_agent.tf b/examples/identity_domains/my_trusted_user_agent.tf index 62e20e3265b..112c87569e5 100644 --- a/examples/identity_domains/my_trusted_user_agent.tf +++ b/examples/identity_domains/my_trusted_user_agent.tf @@ -20,7 +20,7 @@ variable "my_trusted_user_agent_start_index" { data "oci_identity_domains_my_trusted_user_agents" "test_my_trusted_user_agents" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_trusted_user_agent_count = var.my_trusted_user_agent_my_trusted_user_agent_count diff --git a/examples/identity_domains/my_user_db_credential.tf b/examples/identity_domains/my_user_db_credential.tf index dbfd18c2dd2..afcb529dd66 100644 --- a/examples/identity_domains/my_user_db_credential.tf +++ b/examples/identity_domains/my_user_db_credential.tf @@ -53,7 +53,7 @@ variable "my_user_db_credential_user_value" { resource "oci_identity_domains_my_user_db_credential" "test_my_user_db_credential" { #Required db_password = var.my_user_db_credential_db_password - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:UserDbCredentials"] #Optional @@ -77,11 +77,20 @@ resource "oci_identity_domains_my_user_db_credential" "test_my_user_db_credentia ocid = var.my_user_db_credential_user_ocid } */ + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + // my* resource will not return non-default fields + tags, + status, + db_password + ] + } } data "oci_identity_domains_my_user_db_credentials" "test_my_user_db_credentials" { #Required - idcs_endpoint = data.oci_identity_domain.test_domain.url + idcs_endpoint = data.oci_identity_domain.test_domain_for_my_endpoint.url #Optional my_user_db_credential_count = var.my_user_db_credential_my_user_db_credential_count diff --git a/examples/identity_domains/oauth2client_credential.tf b/examples/identity_domains/oauth2client_credential.tf index 7642b66f86d..a50b3ef48a3 100644 --- a/examples/identity_domains/oauth2client_credential.tf +++ b/examples/identity_domains/oauth2client_credential.tf @@ -65,7 +65,7 @@ resource "oci_identity_domains_oauth2client_credential" "test_oauth2client_crede } #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.oauth2client_credential_authorization description = var.oauth2client_credential_description @@ -92,6 +92,13 @@ resource "oci_identity_domains_oauth2client_credential" "test_oauth2client_crede #must be a user that exists value = oci_identity_domains_user.test_user.id } + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + status, + urnietfparamsscimschemasoracleidcsextensionself_change_user + ] + } } data "oci_identity_domains_oauth2client_credentials" "test_oauth2client_credentials" { diff --git a/examples/identity_domains/password_policy.tf b/examples/identity_domains/password_policy.tf index 4e2e620b9df..4e9e06ad4a7 100644 --- a/examples/identity_domains/password_policy.tf +++ b/examples/identity_domains/password_policy.tf @@ -190,7 +190,7 @@ resource "oci_identity_domains_password_policy" "test_password_policy" { #Optional allowed_chars = var.password_policy_allowed_chars - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.password_policy_authorization description = var.password_policy_description diff --git a/examples/identity_domains/smtp_credential.tf b/examples/identity_domains/smtp_credential.tf index dae1ccd0175..0b8106139e9 100644 --- a/examples/identity_domains/smtp_credential.tf +++ b/examples/identity_domains/smtp_credential.tf @@ -47,7 +47,7 @@ resource "oci_identity_domains_smtp_credential" "test_smtp_credential" { schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:smtpCredential"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.smtp_credential_authorization description = var.smtp_credential_description @@ -73,6 +73,13 @@ resource "oci_identity_domains_smtp_credential" "test_smtp_credential" { #must be a user that exists value = oci_identity_domains_user.test_user.id } + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + status, + urnietfparamsscimschemasoracleidcsextensionself_change_user + ] + } } data "oci_identity_domains_smtp_credentials" "test_smtp_credentials" { diff --git a/examples/identity_domains/user.tf b/examples/identity_domains/user.tf index f449d4fb6f5..5f8f1e1f999 100644 --- a/examples/identity_domains/user.tf +++ b/examples/identity_domains/user.tf @@ -720,7 +720,7 @@ resource "oci_identity_domains_user" "test_user" { region = var.user_addresses_region street_address = var.user_addresses_street_address } - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.user_authorization description = var.user_description @@ -735,6 +735,13 @@ resource "oci_identity_domains_user" "test_user" { secondary = var.user_emails_secondary verified = var.user_emails_verified } + #Note: If a new user is created without a recovery email being set, we automatically add one using the primary email value, to ensure the account can be recovered. + #So it is recommended to set an email of type "recovery" like below. If not, it is expected to see an update about recovery email when plan/apply after creation. + emails { + #Required + type = "recovery" + value = var.user_emails_value + } entitlements { #Required type = var.user_entitlements_type @@ -1076,7 +1083,7 @@ resource "oci_identity_domains_user" "test_user" { #adding "schemas" here to ignore any additional schemas returned schemas, #the field is never returned - urnietfparamsscimschemasoracleidcsextensionself_change_user + urnietfparamsscimschemasoracleidcsextensionself_change_user, ] } } diff --git a/examples/identity_domains/user_db_credential.tf b/examples/identity_domains/user_db_credential.tf index 3aeb7d96341..5b397795e85 100644 --- a/examples/identity_domains/user_db_credential.tf +++ b/examples/identity_domains/user_db_credential.tf @@ -48,7 +48,7 @@ resource "oci_identity_domains_user_db_credential" "test_user_db_credential" { schemas = ["urn:ietf:params:scim:schemas:oracle:idcs:UserDbCredentials"] #Optional - attribute_sets = [] + attribute_sets = ["all"] attributes = "" authorization = var.user_db_credential_authorization description = var.user_db_credential_description @@ -75,6 +75,15 @@ resource "oci_identity_domains_user_db_credential" "test_user_db_credential" { #use the ocid of the same user set in value ocid = oci_identity_domains_user.test_user.ocid } + + lifecycle { + ignore_changes = [ + // ignore fields that will never be returned + status, + urnietfparamsscimschemasoracleidcsextensionself_change_user, + db_password + ] + } } data "oci_identity_domains_user_db_credentials" "test_user_db_credentials" { diff --git a/internal/integrationtest/identity_domains_user_test.go b/internal/integrationtest/identity_domains_user_test.go index ce5651cb84d..2351a0657cb 100644 --- a/internal/integrationtest/identity_domains_user_test.go +++ b/internal/integrationtest/identity_domains_user_test.go @@ -109,6 +109,7 @@ var ( "honorific_suffix": acctest.Representation{RepType: acctest.Optional, Create: `honorificSuffix`, Update: `honorificSuffix2`}, "middle_name": acctest.Representation{RepType: acctest.Optional, Create: `middleName`, Update: `middleName2`}, } + IdentityDomainsUserAddressesRepresentation = map[string]interface{}{ "type": acctest.Representation{RepType: acctest.Required, Create: `work`, Update: `home`}, "country": acctest.Representation{RepType: acctest.Optional, Create: `us`, Update: `gb`}, @@ -280,8 +281,9 @@ func TestIdentityDomainsUserResource_basic(t *testing.T) { print(config + compartmentIdVariableStr + IdentityDomainsUserResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_identity_domains_user", "test_user", acctest.Optional, acctest.Create, IdentityDomainsUserRepresentation)) + acctest.ResourceTest(t, testAccCheckIdentityDomainsUserDestroy, []resource.TestStep{ - // verify Create + // verify Create with required fields { Config: config + compartmentIdVariableStr + IdentityDomainsUserResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_identity_domains_user", "test_user", acctest.Required, acctest.Create, IdentityDomainsUserRepresentation), @@ -299,6 +301,24 @@ func TestIdentityDomainsUserResource_basic(t *testing.T) { ), }, + // verify Update with required fields + { + Config: config + compartmentIdVariableStr + IdentityDomainsUserResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_identity_domains_user", "test_user", acctest.Required, acctest.Update, IdentityDomainsUserRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "idcs_endpoint"), + resource.TestCheckResourceAttr(resourceName, "name.#", "1"), + resource.TestCheckResourceAttr(resourceName, "name.0.family_name", "familyName2"), + resource.TestMatchResourceAttr(resourceName, "schemas.#", regexp.MustCompile("[1-9]+")), + resource.TestCheckResourceAttrSet(resourceName, "user_name"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // delete before next Create { Config: config + compartmentIdVariableStr + IdentityDomainsUserResourceDependencies, diff --git a/internal/service/identity_domains/identity_domains_user_resource.go b/internal/service/identity_domains/identity_domains_user_resource.go index 11b6d9b82b0..3efa6fb7e87 100644 --- a/internal/service/identity_domains/identity_domains_user_resource.go +++ b/internal/service/identity_domains/identity_domains_user_resource.go @@ -3976,23 +3976,31 @@ func (s *IdentityDomainsUserResourceCrud) mapToExtensionEnterprise20User(fieldKe result := oci_identity_domains.ExtensionEnterprise20User{} if costCenter, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "cost_center")); ok { - tmp := costCenter.(string) - result.CostCenter = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "cost_center")) { + tmp := costCenter.(string) + result.CostCenter = &tmp + } } if department, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "department")); ok { - tmp := department.(string) - result.Department = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "department")) { + tmp := department.(string) + result.Department = &tmp + } } if division, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "division")); ok { - tmp := division.(string) - result.Division = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "division")) { + tmp := division.(string) + result.Division = &tmp + } } if employeeNumber, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "employee_number")); ok { - tmp := employeeNumber.(string) - result.EmployeeNumber = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "employee_number")) { + tmp := employeeNumber.(string) + result.EmployeeNumber = &tmp + } } if manager, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "manager")); ok { @@ -4007,8 +4015,10 @@ func (s *IdentityDomainsUserResourceCrud) mapToExtensionEnterprise20User(fieldKe } if organization, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "organization")); ok { - tmp := organization.(string) - result.Organization = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "organization")) { + tmp := organization.(string) + result.Organization = &tmp + } } return result, nil @@ -4749,8 +4759,10 @@ func (s *IdentityDomainsUserResourceCrud) mapToExtensionUserStateUser(fieldKeyFo } if maxConcurrentSessions, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "max_concurrent_sessions")); ok { - tmp := maxConcurrentSessions.(int) - result.MaxConcurrentSessions = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "max_concurrent_sessions")) { + tmp := maxConcurrentSessions.(int) + result.MaxConcurrentSessions = &tmp + } } if previousSuccessfulLoginDate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "previous_successful_login_date")); ok { @@ -6642,13 +6654,17 @@ func (s *IdentityDomainsUserResourceCrud) mapToUserIms(fieldKeyFormat string) (o result := oci_identity_domains.UserIms{} if display, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "display")); ok { - tmp := display.(string) - result.Display = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "display")) { + tmp := display.(string) + result.Display = &tmp + } } if primary, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "primary")); ok { - tmp := primary.(bool) - result.Primary = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "primary")) { + tmp := primary.(bool) + result.Primary = &tmp + } } if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { @@ -6656,8 +6672,10 @@ func (s *IdentityDomainsUserResourceCrud) mapToUserIms(fieldKeyFormat string) (o } if value, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "value")); ok { - tmp := value.(string) - result.Value = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "value")) { + tmp := value.(string) + result.Value = &tmp + } } return result, nil @@ -6687,33 +6705,46 @@ func (s *IdentityDomainsUserResourceCrud) mapToUserName(fieldKeyFormat string) ( result := oci_identity_domains.UserName{} if familyName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "family_name")); ok { - tmp := familyName.(string) - result.FamilyName = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "family_name")) { + tmp := familyName.(string) + result.FamilyName = &tmp + } } if formatted, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "formatted")); ok { - tmp := formatted.(string) - result.Formatted = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "formatted")) { + tmp := formatted.(string) + result.Formatted = &tmp + } } if givenName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "given_name")); ok { - tmp := givenName.(string) - result.GivenName = &tmp + // if it's optional with an empty value ("", 0), don't set it to result + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "given_name")) { + tmp := givenName.(string) + result.GivenName = &tmp + } } if honorificPrefix, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "honorific_prefix")); ok { - tmp := honorificPrefix.(string) - result.HonorificPrefix = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "honorific_prefix")) { + tmp := honorificPrefix.(string) + result.HonorificPrefix = &tmp + } } if honorificSuffix, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "honorific_suffix")); ok { - tmp := honorificSuffix.(string) - result.HonorificSuffix = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "honorific_suffix")) { + tmp := honorificSuffix.(string) + result.HonorificSuffix = &tmp + } } if middleName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "middle_name")); ok { - tmp := middleName.(string) - result.MiddleName = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "middle_name")) { + tmp := middleName.(string) + result.MiddleName = &tmp + } } return result, nil @@ -6947,38 +6978,52 @@ func (s *IdentityDomainsUserResourceCrud) mapToaddresses(fieldKeyFormat string) result := oci_identity_domains.Addresses{} if country, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "country")); ok { - tmp := country.(string) - result.Country = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "country")) { + tmp := country.(string) + result.Country = &tmp + } } if formatted, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "formatted")); ok { - tmp := formatted.(string) - result.Formatted = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "formatted")) { + tmp := formatted.(string) + result.Formatted = &tmp + } } if locality, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "locality")); ok { - tmp := locality.(string) - result.Locality = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "locality")) { + tmp := locality.(string) + result.Locality = &tmp + } } if postalCode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "postal_code")); ok { - tmp := postalCode.(string) - result.PostalCode = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "postal_code")) { + tmp := postalCode.(string) + result.PostalCode = &tmp + } } if primary, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "primary")); ok { - tmp := primary.(bool) - result.Primary = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "primary")) { + tmp := primary.(bool) + result.Primary = &tmp + } } if region, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "region")); ok { - tmp := region.(string) - result.Region = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "region")) { + tmp := region.(string) + result.Region = &tmp + } } if streetAddress, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "street_address")); ok { - tmp := streetAddress.(string) - result.StreetAddress = &tmp + if !IsOptionalAndEmpty(s.D, fmt.Sprintf(fieldKeyFormat, "street_address")) { + tmp := streetAddress.(string) + result.StreetAddress = &tmp + } } if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { diff --git a/internal/service/identity_domains/identity_domains_util.go b/internal/service/identity_domains/identity_domains_util.go index 4ed97f21f65..25662c158bd 100644 --- a/internal/service/identity_domains/identity_domains_util.go +++ b/internal/service/identity_domains/identity_domains_util.go @@ -3,6 +3,7 @@ package identity_domains import ( "fmt" "regexp" + "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -63,3 +64,27 @@ func tryMatchUserSubResFilter(value string) string { return value } + +func IsEmptyValued(rawValue interface{}) bool { + return rawValue == "" || rawValue == 0 +} + +func IsOptionalField(fieldPath []string) bool { + pathLen := len(fieldPath) + targetField := fieldPath[pathLen-1] + currentSchemaMap := IdentityDomainsUserResource().Schema + + for i := 0; i < pathLen-1; i++ { + part := fieldPath[i] + if part == "0" { + continue + } + currentSchemaMap = currentSchemaMap[part].Elem.(*schema.Resource).Schema + } + + return currentSchemaMap[targetField].Optional +} + +func IsOptionalAndEmpty(D *schema.ResourceData, fieldKey string) bool { + return IsOptionalField(strings.Split(fieldKey, ".")) && IsEmptyValued(D.Get(fieldKey)) +} From 1e1865a4fbab281f4848a808e0ba2a79e7ab3525 Mon Sep 17 00:00:00 2001 From: Roland Kalmar Date: Mon, 8 May 2023 10:16:27 +0200 Subject: [PATCH 10/16] Added - Remove hardcoded passwords from golden_gate integration test codes --- .../golden_gate_connection_test.go | 37 +++++++++++-------- .../golden_gate_database_registration_test.go | 10 +++-- .../golden_gate_deployment_test.go | 6 ++- .../golden_gate_message_test.go | 28 +++++++------- 4 files changed, 49 insertions(+), 32 deletions(-) diff --git a/internal/integrationtest/golden_gate_connection_test.go b/internal/integrationtest/golden_gate_connection_test.go index 5b29345da5c..5e9f729189a 100644 --- a/internal/integrationtest/golden_gate_connection_test.go +++ b/internal/integrationtest/golden_gate_connection_test.go @@ -32,6 +32,9 @@ Following environment variables are required: - TF_VAR_vault_id - TF_VAR_subnet_id - TF_VAR_oracle_wallet - for oracle connection creation + - TF_VAR_password - password used for create connection, due to sec central issues, we must use environment variables instead of hardcoded passwords + - TF_VAR_new_password - new password used for update connection, due to sec central issues, we must use environment variables instead of hardcoded passwords +" */ import ( "context" @@ -140,7 +143,7 @@ var ( Create: `jdbc:sqlserver://ws1.sql.azuresynapse.net:1433;database=db1;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.sql.azuresynapse.net;loginTimeout=300;'`, Update: `jdbc:sqlserver://ws1.sql.azuresynapse.net:1433;database=db2;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.sql.azuresynapse.net;loginTimeout=300;'`}, "username": acctest.Representation{RepType: acctest.Required, Create: `user`, Update: `updatedUser`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `mypassword`, Update: `newpassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, }, }, @@ -149,7 +152,7 @@ var ( representation: map[string]interface{}{ "host": acctest.Representation{RepType: acctest.Required, Create: `goldengate.oci.oraclecloud.com`, Update: `goldengate2.oci.oraclecloud.com`}, "port": acctest.Representation{RepType: acctest.Required, Create: `9090`, Update: `9091`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `mypassword`, Update: `newpassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "username": acctest.Representation{RepType: acctest.Required, Create: `user`, Update: `updatedUser`}, "private_ip": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.1`, Update: `10.0.0.2`}, }, @@ -172,7 +175,7 @@ var ( "should_use_jndi": acctest.Representation{RepType: acctest.Required, Create: `false`}, "connection_url": acctest.Representation{RepType: acctest.Required, Create: `mq://foo.bar.com:7676`, Update: `mq://foo.bar.com:7677`}, "connection_factory": acctest.Representation{RepType: acctest.Required, Create: `com.stc.jmsjca.core.JConnectionFactoryXA`, Update: `mq://foo.bar.com:7677`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `mypassword`, Update: `newpassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "username": acctest.Representation{RepType: acctest.Required, Create: `user`, Update: `updatedUser`}, "private_ip": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.1`, Update: `10.0.0.2`}, }, @@ -183,7 +186,7 @@ var ( representation: map[string]interface{}{ "security_protocol": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.KafkaConnectionSecurityProtocolSaslSsl)}, "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `password`, Update: `newPassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "bootstrap_servers": acctest.RepresentationGroup{RepType: acctest.Required, Group: map[string]interface{}{ "host": acctest.Representation{RepType: acctest.Required, Create: `whatever.fqdn.oraclecloud.com`}, "port": acctest.Representation{RepType: acctest.Required, Create: `9093`}, @@ -198,7 +201,7 @@ var ( representation: map[string]interface{}{ "authentication_type": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.KafkaSchemaRegistryConnectionAuthenticationTypeBasic)}, "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `password`, Update: `newPassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "url": acctest.Representation{RepType: acctest.Required, Create: `https://10.1.1.1:9091`, Update: `https://10.1.1.2:9091`}, }, }, @@ -211,7 +214,7 @@ var ( "host": acctest.Representation{RepType: acctest.Required, Create: `whatever.fqdn.com`, Update: `whatever.fqdn.com`}, "port": acctest.Representation{RepType: acctest.Required, Create: `10000`, Update: `10001`}, "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `password`, Update: `newPassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "private_ip": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.1`, Update: `10.0.0.2`}, }, }, @@ -219,10 +222,10 @@ var ( // MongoDb {connectionType: oci_golden_gate.ConnectionTypeMongodb, technologyType: oci_golden_gate.TechnologyTypeMongodb, representation: map[string]interface{}{ - "connection_string": acctest.Representation{RepType: acctest.Required, Create: `mongodb://username:password@10.0.0.1:9000`, - Update: `mongodb://newUsername:newPassword@10.0.0.1:9001`}, + "connection_string": acctest.Representation{RepType: acctest.Required, Create: `mongodb://10.0.0.1:9000`, + Update: `mongodb://10.0.0.1:9001`}, "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `password`, Update: `newPassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, }, }, @@ -230,7 +233,7 @@ var ( {connectionType: oci_golden_gate.ConnectionTypeMysql, technologyType: oci_golden_gate.TechnologyTypeOciMysql, representation: map[string]interface{}{ "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `password`, Update: `newPassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "database_name": acctest.Representation{RepType: acctest.Required, Create: `database`, Update: `anotherdatabase`}, "security_protocol": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.MysqlConnectionSecurityProtocolPlain)}, "private_ip": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.1`, Update: `10.0.0.2`}, @@ -247,7 +250,7 @@ var ( "user_id": acctest.Representation{RepType: acctest.Required, Create: `ocid1.user.oc1..fakeaaaatswfukd4gymkjhngu3yp7galhoqzax6mi4ypgdt44ggbjaz2fake`, Update: `ocid1.user.oc2..fakeaaaatswfukd4gymkjhngu3yp7galhoqzax6mi4ypgdt44ggbjaz2fake`}, "private_key_file": acctest.Representation{RepType: acctest.Required, Create: `my-private-key-file`, Update: `new-private-key-file`}, - "private_key_passphrase": acctest.Representation{RepType: acctest.Required, Create: `mypassphrase`, Update: `newpassphrase`}, + "private_key_passphrase": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "public_key_fingerprint": acctest.Representation{RepType: acctest.Required, Create: `myfingerprint`, Update: `newfingerprint`}, }, }, @@ -256,7 +259,7 @@ var ( {connectionType: oci_golden_gate.ConnectionTypeOracle, technologyType: oci_golden_gate.TechnologyTypeAmazonRdsOracle, representation: map[string]interface{}{ "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `password`, Update: `newPassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "session_mode": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.OracleConnectionSessionModeDirect)}, "connection_string": acctest.Representation{RepType: acctest.Required, Create: `alert-henry-IMUny-dev7-ggs.sub05140125230.integrationvcn.oraclevcn.com:1521/DB0609_phx2hg.sub05140125230.integrationvcn.oraclevcn.com`}, "wallet": acctest.Representation{RepType: acctest.Required, Create: `${var.oracle_wallet}`}, @@ -283,7 +286,7 @@ var ( "host": acctest.Representation{RepType: acctest.Required, Create: `whatever.fqdn.com`, Update: `whatever.fqdn.com`}, "port": acctest.Representation{RepType: acctest.Required, Create: `10000`, Update: `10001`}, "username": acctest.Representation{RepType: acctest.Required, Create: `admin`, Update: `new_admin`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `mypassowrd`, Update: `updatedpassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "security_protocol": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.PostgresqlConnectionSecurityProtocolPlain)}, "private_ip": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.1`, Update: `10.0.0.2`}, }, @@ -296,7 +299,7 @@ var ( Update: `jdbc:snowflake://myaccount.snowflakecomputing.com/?warehouse=dawarehous2&db=database2`}, "authentication_type": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.SnowflakeConnectionAuthenticationTypeBasic)}, "username": acctest.Representation{RepType: acctest.Required, Create: `admin`, Update: `new_admin`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `mypassowrd`, Update: `updatedpassword`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, }, }, } @@ -340,6 +343,8 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) { CONNECTION_TYPE = "connection_type" TECHNOLOGY_TYPE = "technology_type" ORACLE_WALLET = "oracle_wallet" + PASSWORD = "password" + NEW_PASSWORD = "new_password" ) config := acctest.ProviderTestConfig() + @@ -348,7 +353,9 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) { makeVariableStr(KMS_KEY_ID, t) + makeVariableStr(SUBNET_ID, t) + makeVariableStr(VAULT_ID, t) + - makeVariableStr(ORACLE_WALLET, t) + makeVariableStr(ORACLE_WALLET, t) + + makeVariableStr(PASSWORD, t) + + makeVariableStr(NEW_PASSWORD, t) var resId, resId2 string for _, connectionTestDescriptor := range ConnectionTestDescriptors { diff --git a/internal/integrationtest/golden_gate_database_registration_test.go b/internal/integrationtest/golden_gate_database_registration_test.go index 9fd4d07728c..2e7a2334089 100644 --- a/internal/integrationtest/golden_gate_database_registration_test.go +++ b/internal/integrationtest/golden_gate_database_registration_test.go @@ -47,6 +47,8 @@ func TestGoldenGateDatabaseRegistrationResource_basic(t *testing.T) { TEST_DB_ID = "test_db_id" KMS_KEY_ID = "kms_key_id" KMS_VAULT_ID = "kms_vault_id" + PASSWORD = "password" + NEW_PASSWORD = "new_password" ) var ( @@ -80,7 +82,7 @@ func TestGoldenGateDatabaseRegistrationResource_basic(t *testing.T) { "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, "fqdn": acctest.Representation{RepType: acctest.Required, Create: `fqdn.example.com`, Update: `fqdn2.example.com`}, - "password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`, Update: `BEstrO0ng_#12`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `username2`}, "connection_string": acctest.Representation{RepType: acctest.Optional, Create: `fqdn.example.com:1521/ORION_phx1gq.example.com`, Update: `fqdn2.example.com:1521/ORION_phx1gq.example.com`}, "database_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.test_db_id}`}, @@ -119,6 +121,8 @@ func TestGoldenGateDatabaseRegistrationResource_basic(t *testing.T) { makeVariableStr(TEST_DB_ID, t) + makeVariableStr(KMS_KEY_ID, t) + makeVariableStr(KMS_VAULT_ID, t) + + makeVariableStr(PASSWORD, t) + + makeVariableStr(NEW_PASSWORD, t) + DatabaseRegistrationResourceDependencies // 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. @@ -135,7 +139,7 @@ func TestGoldenGateDatabaseRegistrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "fqdn", "fqdn.example.com"), - resource.TestCheckResourceAttr(resourceName, "password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttrSet(resourceName, "password"), resource.TestCheckResourceAttr(resourceName, "username", "username"), func(s *terraform.State) (err error) { @@ -165,7 +169,7 @@ func TestGoldenGateDatabaseRegistrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "key_id"), - resource.TestCheckResourceAttr(resourceName, "password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttrSet(resourceName, "password"), resource.TestCheckResourceAttrSet(resourceName, "secret_compartment_id"), resource.TestCheckResourceAttr(resourceName, "session_mode", "DIRECT"), resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), diff --git a/internal/integrationtest/golden_gate_deployment_test.go b/internal/integrationtest/golden_gate_deployment_test.go index 38c93db34c1..fe568748d5a 100644 --- a/internal/integrationtest/golden_gate_deployment_test.go +++ b/internal/integrationtest/golden_gate_deployment_test.go @@ -36,6 +36,8 @@ func TestGoldenGateDeploymentResource_basic(t *testing.T) { DEPLOYMENT_OGG_KEY = "golden_gate_deployment_ogg_key" BASE_OGG_VERSION = "base_ogg_version" UPGRADED_OGG_VERSION = "upgraded_ogg_version" + PASSWORD = "password" + NEW_PASSWORD = "new_password" ) var ( @@ -74,7 +76,7 @@ func TestGoldenGateDeploymentResource_basic(t *testing.T) { } goldenGateDeploymentOggDataRepresentation = map[string]interface{}{ - "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`, Update: `BEstrO0ng_#12`}, + "admin_password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "admin_username": acctest.Representation{RepType: acctest.Required, Create: `adminUsername`, Update: `adminUsername2`}, "deployment_name": acctest.Representation{RepType: acctest.Required, Create: `depl_test_ggs_deployment_name`}, "certificate": acctest.Representation{RepType: acctest.Optional, Create: ``, Update: `-----BEGIN CERTIFICATE-----\nMIICljCCAX4CCQCEpaMjTCJ8WzANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJV\nUzAeFw0yMTAxMTkyMTI2MjRaFw0yNDAxMTkyMTI2MjRaMA0xCzAJBgNVBAYTAlVT\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo83kaUQXpCcSoEuRVFX3\njztWDNKtWpjNG240f0RpERI1NnZtHH0qnZqfaWAQQa8kx3+W1LOeFbkkRnkJz19g\neIXR6TeavT+W5iRh4goK+N7gubYkSMa2shVf+XsoHKERSbhdhrtX+GqvKzAvplCt\nCgd4MDlsvLv/YHCLvJL4JgRxKyevjlnE1rqrICJMCLbbZMrIKTzwb/K13hGrm6Bc\n+Je9EC3MWWxd5jBwXu3vgIYRuGR4DPg/yfMKPZr2xFDLpBsv5jaqULS9t6GwoEBJ\nKN0NXp5obaQToYqMsvAZyHoEyfCBDka16Bm5hGF60FwqgUT3p/+qlBn61cAJe9t5\n8QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAX1rxV2hai02Pb4Cf8U44zj+1aY6wV\nLvOMWiL3zl53up4/X7PDcmWcPM9UMVCGTISZD6A6IPvNlkvbtvYCzgjhtGxDmrj7\nwTRV5gO9j3bAhxBO7XgTmwmD/9hpykM58nbhLFnkGf+Taja8qsy0U8H74Tr9w1M8\n8E5kghgGzBElNquM8AUuDakC1JL4aLO/VDMxe/1BLtmBHLZy3XTzVycjP9ZFPh6h\nT+cWJcVOjQSYY2U75sDnKD2Sg1cmK54HauA6SPh4kAkpmxyLyDZZjPBQe2sLFmmS\naZSE+g16yMR9TVHo3pTpRkxJwDEH0LePwYXA4vUIK3HHS6zgLe0ody8g\n-----END CERTIFICATE-----`}, @@ -125,6 +127,8 @@ func TestGoldenGateDeploymentResource_basic(t *testing.T) { makeVariableStr(DEPLOYMENT_OGG_KEY, t) + makeVariableStr(BASE_OGG_VERSION, t) + makeVariableStr(UPGRADED_OGG_VERSION, t) + + makeVariableStr(PASSWORD, t) + + makeVariableStr(NEW_PASSWORD, t) + GoldenGateDeploymentResourceDependencies // 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. diff --git a/internal/integrationtest/golden_gate_message_test.go b/internal/integrationtest/golden_gate_message_test.go index 4eaa1e56f82..174378c5a4a 100644 --- a/internal/integrationtest/golden_gate_message_test.go +++ b/internal/integrationtest/golden_gate_message_test.go @@ -4,15 +4,12 @@ package integrationtest import ( - "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/oracle/terraform-provider-oci/httpreplay" "github.com/oracle/terraform-provider-oci/internal/acctest" - - "github.com/oracle/terraform-provider-oci/internal/utils" ) var ( @@ -24,7 +21,7 @@ var ( "deployment_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_golden_gate_deployment.test_deployment.id}`}, } goldenGateDeploymentOggDataRepresentation = map[string]interface{}{ - "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`, Update: `BEstrO0ng_#12`}, + "admin_password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`}, "admin_username": acctest.Representation{RepType: acctest.Required, Create: `adminUsername`, Update: `adminUsername2`}, "deployment_name": acctest.Representation{RepType: acctest.Required, Create: `depl_test_ggs_deployment_name`}, "certificate": acctest.Representation{RepType: acctest.Optional, Create: ``, Update: `-----BEGIN CERTIFICATE-----\nMIICljCCAX4CCQCEpaMjTCJ8WzANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJV\nUzAeFw0yMTAxMTkyMTI2MjRaFw0yNDAxMTkyMTI2MjRaMA0xCzAJBgNVBAYTAlVT\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo83kaUQXpCcSoEuRVFX3\njztWDNKtWpjNG240f0RpERI1NnZtHH0qnZqfaWAQQa8kx3+W1LOeFbkkRnkJz19g\neIXR6TeavT+W5iRh4goK+N7gubYkSMa2shVf+XsoHKERSbhdhrtX+GqvKzAvplCt\nCgd4MDlsvLv/YHCLvJL4JgRxKyevjlnE1rqrICJMCLbbZMrIKTzwb/K13hGrm6Bc\n+Je9EC3MWWxd5jBwXu3vgIYRuGR4DPg/yfMKPZr2xFDLpBsv5jaqULS9t6GwoEBJ\nKN0NXp5obaQToYqMsvAZyHoEyfCBDka16Bm5hGF60FwqgUT3p/+qlBn61cAJe9t5\n8QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAX1rxV2hai02Pb4Cf8U44zj+1aY6wV\nLvOMWiL3zl53up4/X7PDcmWcPM9UMVCGTISZD6A6IPvNlkvbtvYCzgjhtGxDmrj7\nwTRV5gO9j3bAhxBO7XgTmwmD/9hpykM58nbhLFnkGf+Taja8qsy0U8H74Tr9w1M8\n8E5kghgGzBElNquM8AUuDakC1JL4aLO/VDMxe/1BLtmBHLZy3XTzVycjP9ZFPh6h\nT+cWJcVOjQSYY2U75sDnKD2Sg1cmK54HauA6SPh4kAkpmxyLyDZZjPBQe2sLFmmS\naZSE+g16yMR9TVHo3pTpRkxJwDEH0LePwYXA4vUIK3HHS6zgLe0ody8g\n-----END CERTIFICATE-----`}, @@ -36,7 +33,7 @@ var ( "deployment_type": acctest.Representation{RepType: acctest.Required, Create: `OGG`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, "is_auto_scaling_enabled": acctest.Representation{RepType: acctest.Required, Create: `false`}, - "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.test_subnet_id}`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`}, "license_model": acctest.Representation{RepType: acctest.Required, Create: `LICENSE_INCLUDED`}, "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "fqdn": acctest.Representation{RepType: acctest.Optional, Create: ``}, @@ -56,13 +53,18 @@ func TestGoldenGateMessageResource_basic(t *testing.T) { httpreplay.SetScenario("TestGoldenGateMessageResource_basic") defer httpreplay.SaveScenario() - config := acctest.ProviderTestConfig() - - compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") - compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + const ( + COMPARTMENT_ID = "compartment_id" + SUBNET_ID = "subnet_id" + PASSWORD = "password" + NEW_PASSWORD = "new_password" + ) - subnetId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subnet_id") - subnetIdVariableStr := fmt.Sprintf("variable \"test_subnet_id\" { default = \"%s\" }\n", subnetId) + config := acctest.ProviderTestConfig() + + makeVariableStr(COMPARTMENT_ID, t) + + makeVariableStr(SUBNET_ID, t) + + makeVariableStr(PASSWORD, t) + + makeVariableStr(NEW_PASSWORD, t) datasourceName := "data.oci_golden_gate_messages.test_messages" singularDatasourceName := "data.oci_golden_gate_message.test_message" @@ -74,7 +76,7 @@ func TestGoldenGateMessageResource_basic(t *testing.T) { { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_golden_gate_messages", "test_messages", acctest.Required, acctest.Create, GoldenGateGoldenGateMessageDataSourceRepresentation) + - compartmentIdVariableStr + subnetIdVariableStr + GoldenGateMessageResourceConfig, + GoldenGateMessageResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(datasourceName, "deployment_id"), @@ -89,7 +91,7 @@ func TestGoldenGateMessageResource_basic(t *testing.T) { { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_golden_gate_message", "test_message", acctest.Required, acctest.Create, GoldenGateGoldenGateMessageSingularDataSourceRepresentation) + - compartmentIdVariableStr + subnetIdVariableStr + GoldenGateMessageResourceConfig, + GoldenGateMessageResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "deployment_id"), From 60138d29ec485277a3e5384a6d47358be7bbf2c9 Mon Sep 17 00:00:00 2001 From: Sagar Pokale Date: Fri, 19 May 2023 15:50:58 -0500 Subject: [PATCH 11/16] Vendored - oci-go-sdk v65.39.0 changes for existing & new services --- go.mod | 2 +- .../oracle/oci-go-sdk/v65/common/client.go | 7 +- .../oracle/oci-go-sdk/v65/common/common.go | 4 +- .../oci-go-sdk/v65/common/configuration.go | 8 +- .../database/autonomous_container_database.go | 2 +- .../autonomous_container_database_summary.go | 2 +- .../v65/database/autonomous_database.go | 2 +- .../database/autonomous_database_summary.go | 2 +- .../database/autonomous_virtual_machine.go | 3 + .../autonomous_virtual_machine_summary.go | 3 + .../v65/database/autonomous_vm_cluster.go | 6 +- ...autonomous_vm_cluster_resource_details.go} | 27 +-- .../database/autonomous_vm_cluster_summary.go | 6 +- .../database/cloud_autonomous_vm_cluster.go | 5 +- .../cloud_autonomous_vm_cluster_summary.go | 5 +- ...e_autonomous_container_database_details.go | 2 +- .../create_autonomous_vm_cluster_details.go | 2 +- ...ate_cloud_autonomous_vm_cluster_details.go | 2 +- .../v65/database/database_client.go | 57 +++++ .../v65/database/exadata_infrastructure.go | 3 + .../exadata_infrastructure_summary.go | 3 + ...a_infrastructure_un_allocated_resources.go | 57 +++++ ..._unallocated_resources_request_response.go | 3 + ...n_allocated_resources_request_response.go} | 52 +++-- ...utonomous_vm_cluster_ords_certs_details.go | 2 +- ...autonomous_vm_cluster_ssl_certs_details.go | 4 +- ...utonomous_vm_cluster_ords_certs_details.go | 2 +- ...autonomous_vm_cluster_ssl_certs_details.go | 2 +- .../oci-go-sdk/v65/database/vm_cluster.go | 3 + .../v65/database/vm_cluster_summary.go | 3 + .../oci-go-sdk/v65/dns/create_zone_details.go | 4 + ...te_zone_from_zone_file_request_response.go | 161 +++++++++++++ .../oracle/oci-go-sdk/v65/dns/dns_client.go | 57 +++++ .../oci-go-sdk/v65/dns/external_downstream.go | 49 ++++ .../oci-go-sdk/v65/dns/update_zone_details.go | 4 + .../oracle/oci-go-sdk/v65/dns/zone.go | 4 + .../oci-go-sdk/v65/logging/action_types.go | 5 +- .../oci-go-sdk/v65/logging/archiving.go | 7 +- .../oracle/oci-go-sdk/v65/logging/category.go | 7 +- .../change_log_group_compartment_details.go | 5 +- .../logging/change_log_log_group_details.go | 5 +- ...ge_log_saved_search_compartment_details.go | 7 +- ...ved_search_compartment_request_response.go | 2 +- ...agent_configuration_compartment_details.go | 5 +- .../oci-go-sdk/v65/logging/configuration.go | 5 +- .../v65/logging/create_log_details.go | 7 +- .../v65/logging/create_log_group_details.go | 5 +- .../create_log_saved_search_details.go | 7 +- ...reate_log_saved_search_request_response.go | 2 +- ...ate_unified_agent_configuration_details.go | 5 +- ...elete_log_saved_search_request_response.go | 2 +- .../get_log_saved_search_request_response.go | 2 +- .../oci-go-sdk/v65/logging/grok_pattern.go | 5 +- .../v65/logging/group_association_details.go | 5 +- .../list_log_groups_request_response.go | 2 +- ..._log_included_searches_request_response.go | 212 ------------------ ...ist_log_saved_searches_request_response.go | 4 +- .../v65/logging/list_logs_request_response.go | 6 +- .../logging/list_services_request_response.go | 3 + ...d_agent_configurations_request_response.go | 2 +- .../oracle/oci-go-sdk/v65/logging/log.go | 7 +- .../oci-go-sdk/v65/logging/log_group.go | 5 +- .../v65/logging/log_group_lifecycle_state.go | 5 +- .../v65/logging/log_group_summary.go | 5 +- .../v65/logging/log_included_search.go | 65 ------ .../log_included_search_summary_collection.go | 39 ---- .../v65/logging/log_lifecycle_state.go | 5 +- .../v65/logging/log_saved_search.go | 7 +- .../log_saved_search_lifecycle_state.go | 5 +- .../v65/logging/log_saved_search_summary.go | 7 +- .../log_saved_search_summary_collection.go | 5 +- .../oci-go-sdk/v65/logging/log_summary.go | 7 +- .../logging_loggingmanagement_client.go | 127 +---------- .../oci-go-sdk/v65/logging/oci_service.go | 5 +- .../v65/logging/operation_status.go | 5 +- .../oci-go-sdk/v65/logging/operation_types.go | 5 +- .../oci-go-sdk/v65/logging/parameter.go | 40 +++- .../oci-go-sdk/v65/logging/resource_type.go | 5 +- .../oci-go-sdk/v65/logging/service_summary.go | 5 +- .../oracle/oci-go-sdk/v65/logging/source.go | 5 +- .../v65/logging/source_update_details.go | 5 +- .../logging/unified_agent_apache2_parser.go | 22 +- .../unified_agent_apache_error_parser.go | 22 +- .../logging/unified_agent_auditd_parser.go | 22 +- .../logging/unified_agent_configuration.go | 5 +- .../unified_agent_configuration_collection.go | 5 +- .../unified_agent_configuration_summary.go | 5 +- .../v65/logging/unified_agent_cri_parser.go | 133 +++++++++++ .../v65/logging/unified_agent_csv_parser.go | 28 ++- .../v65/logging/unified_agent_grok_parser.go | 29 ++- .../unified_agent_logging_configuration.go | 11 +- .../unified_agent_logging_destination.go | 5 +- .../logging/unified_agent_logging_source.go | 5 +- .../logging/unified_agent_msgpack_parser.go | 22 +- .../unified_agent_multiline_grok_parser.go | 30 ++- .../logging/unified_agent_multiline_parser.go | 28 ++- .../v65/logging/unified_agent_none_parser.go | 23 +- .../v65/logging/unified_agent_parser.go | 30 ++- .../v65/logging/unified_agent_regex_parser.go | 28 ++- ...ied_agent_service_configuration_details.go | 5 +- ...fied_agent_service_configuration_states.go | 5 +- ...ified_agent_service_configuration_types.go | 5 +- .../logging/unified_agent_syslog_parser.go | 28 ++- .../logging/unified_agent_tail_log_source.go | 20 +- .../v65/logging/unified_agent_tsv_parser.go | 28 ++- .../unified_agent_windows_event_source.go | 8 +- .../v65/logging/unified_json_parser.go | 24 +- .../logging/update_configuration_details.go | 5 +- .../v65/logging/update_log_details.go | 7 +- .../v65/logging/update_log_group_details.go | 5 +- .../update_log_saved_search_details.go | 7 +- ...pdate_log_saved_search_request_response.go | 2 +- ...ate_unified_agent_configuration_details.go | 5 +- .../oci-go-sdk/v65/logging/work_request.go | 7 +- .../v65/logging/work_request_error.go | 5 +- .../v65/logging/work_request_log.go | 5 +- .../v65/logging/work_request_resource.go | 5 +- .../v65/logging/work_request_summary.go | 7 +- vendor/modules.txt | 2 +- 119 files changed, 1245 insertions(+), 634 deletions(-) rename vendor/github.com/oracle/oci-go-sdk/v65/{logging/log_included_search_summary.go => database/autonomous_vm_cluster_resource_details.go} (50%) create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_un_allocated_resources.go rename vendor/github.com/oracle/oci-go-sdk/v65/{logging/get_log_included_search_request_response.go => database/get_exadata_infrastructure_un_allocated_resources_request_response.go} (53%) create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_from_zone_file_request_response.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/dns/external_downstream.go delete mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_included_searches_request_response.go delete mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search.go delete mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search_summary_collection.go create mode 100644 vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_cri_parser.go diff --git a/go.mod b/go.mod index f12ac8d6b33..0e8fb0af42c 100644 --- a/go.mod +++ b/go.mod @@ -76,6 +76,6 @@ require ( ) // Uncomment this line to get OCI Go SDK from local source instead of github -//replace github.com/oracle/oci-go-sdk => ../../oracle/oci-go-sdk +replace github.com/oracle/oci-go-sdk/v65 v65.38.0 => ./vendor/github.com/oracle/oci-go-sdk go 1.18 diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go index 116ee0e4f6f..ff02e129d1c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/client.go @@ -20,6 +20,7 @@ import ( "os" "os/user" "path" + "path/filepath" "reflect" "runtime" "strings" @@ -324,7 +325,7 @@ func getHomeFolder() string { func DefaultConfigProvider() ConfigurationProvider { defaultConfigFile := getDefaultConfigFilePath() homeFolder := getHomeFolder() - secondaryConfigFile := path.Join(homeFolder, secondaryConfigDirName, defaultConfigFileName) + secondaryConfigFile := filepath.Join(homeFolder, secondaryConfigDirName, defaultConfigFileName) defaultFileProvider, _ := ConfigurationProviderFromFile(defaultConfigFile, "") secondaryFileProvider, _ := ConfigurationProviderFromFile(secondaryConfigFile, "") @@ -337,7 +338,7 @@ func DefaultConfigProvider() ConfigurationProvider { func getDefaultConfigFilePath() string { homeFolder := getHomeFolder() - defaultConfigFile := path.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) + defaultConfigFile := filepath.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) if _, err := os.Stat(defaultConfigFile); err == nil { return defaultConfigFile } @@ -383,7 +384,7 @@ func setRawPath(u *url.URL) error { func CustomProfileConfigProvider(customConfigPath string, profile string) ConfigurationProvider { homeFolder := getHomeFolder() if customConfigPath == "" { - customConfigPath = path.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) + customConfigPath = filepath.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) } customFileProvider, _ := ConfigurationProviderFromFileWithProfile(customConfigPath, profile, "") defaultFileProvider, _ := ConfigurationProviderFromFileWithProfile(customConfigPath, "DEFAULT", "") diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go index 6061c1a2d93..079ee179709 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/common.go @@ -9,7 +9,7 @@ import ( "io/ioutil" "net/http" "os" - "path" + "path/filepath" "regexp" "strings" "time" @@ -244,7 +244,7 @@ func setRegionMetadataFromCfgFile(region *string) bool { // Mark readCfgFile Flag as false since it has already been visited. readCfgFile = false homeFolder := getHomeFolder() - configFile := path.Join(homeFolder, regionMetadataCfgDirName, regionMetadataCfgFileName) + configFile := filepath.Join(homeFolder, regionMetadataCfgDirName, regionMetadataCfgFileName) if jsonArr, ok := readAndParseConfigFile(&configFile); ok { added := false for _, jsonItem := range jsonArr { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go index 2989598a437..4176535cd1f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/configuration.go @@ -9,7 +9,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" "regexp" "strings" ) @@ -380,12 +380,12 @@ func parseConfigAtLine(start int, content []string) (info *configFileInfo, err e // cleans and expands the path if it contains a tilde , returns the expanded path or the input path as is if not expansion // was performed -func expandPath(filepath string) (expandedPath string) { - cleanedPath := path.Clean(filepath) +func expandPath(filename string) (expandedPath string) { + cleanedPath := filepath.Clean(filename) expandedPath = cleanedPath if strings.HasPrefix(cleanedPath, "~") { rest := cleanedPath[2:] - expandedPath = path.Join(getHomeFolder(), rest) + expandedPath = filepath.Join(getHomeFolder(), rest) } return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database.go index 97e44d05b7c..0f9078690e7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database.go @@ -39,7 +39,7 @@ type AutonomousContainerDatabase struct { // **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. DbUniqueName *string `mandatory:"false" json:"dbUniqueName"` - // The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. + // The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. DbName *string `mandatory:"false" json:"dbName"` // **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database_summary.go index 2e0b9af77f6..0555c51a90d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_container_database_summary.go @@ -39,7 +39,7 @@ type AutonomousContainerDatabaseSummary struct { // **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. DbUniqueName *string `mandatory:"false" json:"dbUniqueName"` - // The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. + // The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. DbName *string `mandatory:"false" json:"dbName"` // **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go index 84cc8c4fbcf..4a43b3eeba3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go @@ -108,7 +108,7 @@ type AutonomousDatabase struct { // An array of CPU values that an Autonomous Database can be scaled to. ProvisionableCpus []float32 `mandatory:"false" json:"provisionableCpus"` - // The amount of memory (in GBs) enabled per each CPU in the Autonomous VM Cluster. + // The amount of memory (in GBs) enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` // The quantity of data in the database, in gigabytes. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go index 1028d3c0247..b30b2189e65 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go @@ -109,7 +109,7 @@ type AutonomousDatabaseSummary struct { // An array of CPU values that an Autonomous Database can be scaled to. ProvisionableCpus []float32 `mandatory:"false" json:"provisionableCpus"` - // The amount of memory (in GBs) enabled per each CPU in the Autonomous VM Cluster. + // The amount of memory (in GBs) enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` // The quantity of data in the database, in gigabytes. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine.go index bf2179c21c5..b30cf16751b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine.go @@ -59,6 +59,9 @@ type AutonomousVirtualMachine struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cloud Autonomous VM Cluster associated with the Autonomous Virtual Machine. + CloudAutonomousVmClusterId *string `mandatory:"false" json:"cloudAutonomousVmClusterId"` } func (m AutonomousVirtualMachine) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine_summary.go index 220f89e1451..2b46b7e7560 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_virtual_machine_summary.go @@ -59,6 +59,9 @@ type AutonomousVirtualMachineSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Cloud Autonomous VM Cluster associated with the Autonomous Virtual Machine. + CloudAutonomousVmClusterId *string `mandatory:"false" json:"cloudAutonomousVmClusterId"` } func (m AutonomousVirtualMachineSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster.go index 39cffb5bbf2..906409bd902 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster.go @@ -63,7 +63,7 @@ type AutonomousVmCluster struct { // The total number of Autonomous Container Databases that can be created. TotalContainerDatabases *int `mandatory:"false" json:"totalContainerDatabases"` - // The amount of memory (in GBs) to be enabled per each CPU core. + // The amount of memory (in GBs) to be enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` // The number of CPU cores enabled per VM cluster node. @@ -133,10 +133,10 @@ type AutonomousVmCluster struct { // Enable mutual TLS(mTLS) authentication for database while provisioning a VMCluster. Default is TLS. IsMtlsEnabled *bool `mandatory:"false" json:"isMtlsEnabled"` - // The date and time of Database SSL certificate expiration. + // The date and time of the Database SSL certificate expiration. TimeDatabaseSslCertificateExpires *common.SDKTime `mandatory:"false" json:"timeDatabaseSslCertificateExpires"` - // The date and time of ORDS certificate expiration. + // The date and time of the ORDS certificate expiration. TimeOrdsCertificateExpires *common.SDKTime `mandatory:"false" json:"timeOrdsCertificateExpires"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_resource_details.go similarity index 50% rename from vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search_summary.go rename to vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_resource_details.go index 558f179404a..b253df28b63 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_resource_details.go @@ -2,12 +2,12 @@ // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. -// Logging Management API +// Database Service API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). // -package logging +package database import ( "fmt" @@ -15,31 +15,24 @@ import ( "strings" ) -// LogIncludedSearchSummary A summary of what the OCI included search does. -type LogIncludedSearchSummary struct { +// AutonomousVmClusterResourceDetails Unallocated resource details of the AVM +type AutonomousVmClusterResourceDetails struct { - // The OCID of the resource. + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. Id *string `mandatory:"true" json:"id"` - // The user-friendly display name. This must be unique within the enclosing resource, - // and it's changeable. Avoid entering confidential information. - DisplayName *string `mandatory:"true" json:"displayName"` - - // Time the resource was created. - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - - // Time the resource was last modified. - TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` + // Total unallocated autonomous data storage in the AVM in TBs. + UnAllocatedAdbStorageInTBs *float64 `mandatory:"true" json:"unAllocatedAdbStorageInTBs"` } -func (m LogIncludedSearchSummary) String() string { +func (m AutonomousVmClusterResourceDetails) String() string { return common.PointerString(m) } // ValidateEnumValue returns an error when providing an unsupported enum value // This function is being called during constructing API request process // Not recommended for calling this function directly -func (m LogIncludedSearchSummary) ValidateEnumValue() (bool, error) { +func (m AutonomousVmClusterResourceDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_summary.go index 9c3bacdcab7..7ebb3f4b13c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_vm_cluster_summary.go @@ -63,7 +63,7 @@ type AutonomousVmClusterSummary struct { // The total number of Autonomous Container Databases that can be created. TotalContainerDatabases *int `mandatory:"false" json:"totalContainerDatabases"` - // The amount of memory (in GBs) to be enabled per each CPU core. + // The amount of memory (in GBs) to be enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` // The number of CPU cores enabled per VM cluster node. @@ -133,10 +133,10 @@ type AutonomousVmClusterSummary struct { // Enable mutual TLS(mTLS) authentication for database while provisioning a VMCluster. Default is TLS. IsMtlsEnabled *bool `mandatory:"false" json:"isMtlsEnabled"` - // The date and time of Database SSL certificate expiration. + // The date and time of the Database SSL certificate expiration. TimeDatabaseSslCertificateExpires *common.SDKTime `mandatory:"false" json:"timeDatabaseSslCertificateExpires"` - // The date and time of ORDS certificate expiration. + // The date and time of the ORDS certificate expiration. TimeOrdsCertificateExpires *common.SDKTime `mandatory:"false" json:"timeOrdsCertificateExpires"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster.go index d7091ff1fbe..725ebf506ec 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster.go @@ -162,8 +162,11 @@ type CloudAutonomousVmCluster struct { // The local node storage allocated in GBs. DbNodeStorageSizeInGBs *int `mandatory:"false" json:"dbNodeStorageSizeInGBs"` - // The amount of memory (in GBs) enabled per each CPU core. + // The amount of memory (in GBs) enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` + + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Db servers. + DbServers []string `mandatory:"false" json:"dbServers"` } func (m CloudAutonomousVmCluster) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster_summary.go index e1be5f0d761..e39abc94269 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/cloud_autonomous_vm_cluster_summary.go @@ -162,8 +162,11 @@ type CloudAutonomousVmClusterSummary struct { // The local node storage allocated in GBs. DbNodeStorageSizeInGBs *int `mandatory:"false" json:"dbNodeStorageSizeInGBs"` - // The amount of memory (in GBs) enabled per each CPU core. + // The amount of memory (in GBs) enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` + + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Db servers. + DbServers []string `mandatory:"false" json:"dbServers"` } func (m CloudAutonomousVmClusterSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_container_database_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_container_database_details.go index 0b964f3b0f5..9f53eb4678f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_container_database_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_container_database_details.go @@ -27,7 +27,7 @@ type CreateAutonomousContainerDatabaseDetails struct { // **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. DbUniqueName *string `mandatory:"false" json:"dbUniqueName"` - // The database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, must start with an alphabetic character and followed by 1 to 7 alphanumeric characters. + // The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. DbName *string `mandatory:"false" json:"dbName"` // The service level agreement type of the Autonomous Container Database. The default is STANDARD. For an autonomous dataguard Autonomous Container Database, the specified Autonomous Exadata Infrastructure must be associated with a remote Autonomous Exadata Infrastructure. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_vm_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_vm_cluster_details.go index 49c1248db70..8cb97c573af 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_vm_cluster_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_vm_cluster_details.go @@ -48,7 +48,7 @@ type CreateAutonomousVmClusterDetails struct { // The compute model of the Autonomous VM Cluster. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. ComputeModel CreateAutonomousVmClusterDetailsComputeModelEnum `mandatory:"false" json:"computeModel,omitempty"` - // The amount of memory (in GBs) to be enabled per each CPU core. + // The amount of memory (in GBs) to be enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` // The data disk group size to be allocated for Autonomous Databases, in TBs. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_autonomous_vm_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_autonomous_vm_cluster_details.go index daff35036f4..4dbf20dfbe1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_autonomous_vm_cluster_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_autonomous_vm_cluster_details.go @@ -39,7 +39,7 @@ type CreateCloudAutonomousVmClusterDetails struct { // The number of CPU cores to be enabled per VM cluster node. CpuCoreCountPerNode *int `mandatory:"false" json:"cpuCoreCountPerNode"` - // The amount of memory (in GBs) to be enabled per each CPU core. + // The amount of memory (in GBs) to be enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure (https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. MemoryPerOracleComputeUnitInGBs *int `mandatory:"false" json:"memoryPerOracleComputeUnitInGBs"` // The data disk group size to be allocated for Autonomous Databases, in TBs. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go index 2bb37cabb57..57b018f6926 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go @@ -9178,6 +9178,63 @@ func (client DatabaseClient) getExadataInfrastructureOcpus(ctx context.Context, return response, err } +// GetExadataInfrastructureUnAllocatedResources Gets un allocated resources information for the specified Exadata infrastructure. Applies to Exadata Cloud@Customer instances only. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExadataInfrastructureUnAllocatedResources.go.html to see an example of how to use GetExadataInfrastructureUnAllocatedResources API. +func (client DatabaseClient) GetExadataInfrastructureUnAllocatedResources(ctx context.Context, request GetExadataInfrastructureUnAllocatedResourcesRequest) (response GetExadataInfrastructureUnAllocatedResourcesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getExadataInfrastructureUnAllocatedResources, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetExadataInfrastructureUnAllocatedResourcesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetExadataInfrastructureUnAllocatedResourcesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetExadataInfrastructureUnAllocatedResourcesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetExadataInfrastructureUnAllocatedResourcesResponse") + } + return +} + +// getExadataInfrastructureUnAllocatedResources implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) getExadataInfrastructureUnAllocatedResources(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/exadataInfrastructures/{exadataInfrastructureId}/unAllocatedResources", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetExadataInfrastructureUnAllocatedResourcesResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/database/20160918/ExadataInfrastructureUnAllocatedResources/GetExadataInfrastructureUnAllocatedResources" + err = common.PostProcessServiceError(err, "Database", "GetExadataInfrastructureUnAllocatedResources", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetExadataIormConfig Gets the IORM configuration settings for the specified cloud Exadata DB system. // All Exadata service instances have default IORM settings. // **Note:** Deprecated for Exadata Cloud Service systems. Use the new resource model APIs (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem.htm#exaflexsystem_topic-resource_model) instead. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure.go index 3c138eefb8e..8d127ed482c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure.go @@ -155,6 +155,9 @@ type ExadataInfrastructure struct { NetworkBondingModeDetails *NetworkBondingModeDetails `mandatory:"false" json:"networkBondingModeDetails"` + // The name of the availability domain that the Exadata infrastructure is located in. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_summary.go index 1ea0ed3f672..6b3905ece82 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_summary.go @@ -156,6 +156,9 @@ type ExadataInfrastructureSummary struct { NetworkBondingModeDetails *NetworkBondingModeDetails `mandatory:"false" json:"networkBondingModeDetails"` + // The name of the availability domain that the Exadata infrastructure is located in. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_un_allocated_resources.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_un_allocated_resources.go new file mode 100644 index 00000000000..f32e150516b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/exadata_infrastructure_un_allocated_resources.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExadataInfrastructureUnAllocatedResources Un allocated resources details of the Exadata Cloud@Customer infrastructure. Applies to Exadata Cloud@Customer instances only. +type ExadataInfrastructureUnAllocatedResources struct { + + // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. + Id *string `mandatory:"true" json:"id"` + + // The user-friendly name for the Exadata Cloud@Customer infrastructure. The name does not need to be unique. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The minimum amount of un allocated storage that is available across all nodes in the infrastructure. + LocalStorageInGbs *int `mandatory:"false" json:"localStorageInGbs"` + + // The minimum amount of un allocated ocpus that is available across all nodes in the infrastructure. + Ocpus *int `mandatory:"false" json:"ocpus"` + + // The minimum amount of un allocated memory that is available across all nodes in the infrastructure. + MemoryInGBs *int `mandatory:"false" json:"memoryInGBs"` + + // Total unallocated exadata storage in the infrastructure in TBs. + ExadataStorageInTBs *float64 `mandatory:"false" json:"exadataStorageInTBs"` + + // The list of Autonomous VM Clusters on the Infra and their associated unallocated resources details + AutonomousVmClusters []AutonomousVmClusterResourceDetails `mandatory:"false" json:"autonomousVmClusters"` +} + +func (m ExadataInfrastructureUnAllocatedResources) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExadataInfrastructureUnAllocatedResources) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/get_cloud_exadata_infrastructure_unallocated_resources_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/get_cloud_exadata_infrastructure_unallocated_resources_request_response.go index 02cc20eda0c..9f9f82036f5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/get_cloud_exadata_infrastructure_unallocated_resources_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/get_cloud_exadata_infrastructure_unallocated_resources_request_response.go @@ -24,6 +24,9 @@ type GetCloudExadataInfrastructureUnallocatedResourcesRequest struct { // Unique identifier for the request. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Db servers. + DbServers []string `contributesTo:"query" name:"dbServers" collectionFormat:"multi"` + // 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/logging/get_log_included_search_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/get_exadata_infrastructure_un_allocated_resources_request_response.go similarity index 53% rename from vendor/github.com/oracle/oci-go-sdk/v65/logging/get_log_included_search_request_response.go rename to vendor/github.com/oracle/oci-go-sdk/v65/database/get_exadata_infrastructure_un_allocated_resources_request_response.go index 0c6753f0250..10688cf2bf0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/get_log_included_search_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/get_exadata_infrastructure_un_allocated_resources_request_response.go @@ -2,7 +2,7 @@ // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache 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 logging +package database import ( "fmt" @@ -11,35 +11,33 @@ import ( "strings" ) -// GetLogIncludedSearchRequest wrapper for the GetLogIncludedSearch operation +// GetExadataInfrastructureUnAllocatedResourcesRequest wrapper for the GetExadataInfrastructureUnAllocatedResources operation // // See also // -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/GetLogIncludedSearch.go.html to see an example of how to use GetLogIncludedSearchRequest. -type GetLogIncludedSearchRequest struct { +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/GetExadataInfrastructureUnAllocatedResources.go.html to see an example of how to use GetExadataInfrastructureUnAllocatedResourcesRequest. +type GetExadataInfrastructureUnAllocatedResourcesRequest struct { - // Compartment OCID to list resources in. See compartmentIdInSubtree - // for nested compartments traversal. - CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + // The Exadata infrastructure OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ExadataInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"exadataInfrastructureId"` - // OCID of the included search - LogIncludedSearchId *string `mandatory:"true" contributesTo:"path" name:"logIncludedSearchId"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. + // Unique identifier for the request. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // The list of OCIDs (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Db servers. + DbServers []string `contributesTo:"query" name:"dbServers" collectionFormat:"multi"` + // 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 GetLogIncludedSearchRequest) String() string { +func (request GetExadataInfrastructureUnAllocatedResourcesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface -func (request GetLogIncludedSearchRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { +func (request GetExadataInfrastructureUnAllocatedResourcesRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { _, err := request.ValidateEnumValue() if err != nil { @@ -49,21 +47,21 @@ func (request GetLogIncludedSearchRequest) HTTPRequest(method, path string, bina } // BinaryRequestBody implements the OCIRequest interface -func (request GetLogIncludedSearchRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { +func (request GetExadataInfrastructureUnAllocatedResourcesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { return nil, false } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. -func (request GetLogIncludedSearchRequest) RetryPolicy() *common.RetryPolicy { +func (request GetExadataInfrastructureUnAllocatedResourcesRequest) 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 GetLogIncludedSearchRequest) ValidateEnumValue() (bool, error) { +func (request GetExadataInfrastructureUnAllocatedResourcesRequest) ValidateEnumValue() (bool, error) { errMessage := []string{} if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -71,28 +69,28 @@ func (request GetLogIncludedSearchRequest) ValidateEnumValue() (bool, error) { return false, nil } -// GetLogIncludedSearchResponse wrapper for the GetLogIncludedSearch operation -type GetLogIncludedSearchResponse struct { +// GetExadataInfrastructureUnAllocatedResourcesResponse wrapper for the GetExadataInfrastructureUnAllocatedResources operation +type GetExadataInfrastructureUnAllocatedResourcesResponse struct { // The underlying http response RawResponse *http.Response - // The LogIncludedSearch instance - LogIncludedSearch `presentIn:"body"` - - // Unique Oracle-assigned identifier for the request. If you need to contact - // Oracle about a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + // The ExadataInfrastructureUnAllocatedResources instance + ExadataInfrastructureUnAllocatedResources `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 GetLogIncludedSearchResponse) String() string { +func (response GetExadataInfrastructureUnAllocatedResourcesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface -func (response GetLogIncludedSearchResponse) HTTPResponse() *http.Response { +func (response GetExadataInfrastructureUnAllocatedResourcesResponse) HTTPResponse() *http.Response { return response.RawResponse } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ords_certs_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ords_certs_details.go index e95e7b2e7a0..76447f5987a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ords_certs_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ords_certs_details.go @@ -18,7 +18,7 @@ import ( // RotateAutonomousVmClusterOrdsCertsDetails The details for configuring the SSL certificates on Autonomous VM Cluster type RotateAutonomousVmClusterOrdsCertsDetails struct { - // Specify SYSTEM for using Oracle managed certificates. Specify BYOC when you want to bring your own certificate. + // Specify SYSTEM to use Oracle-managed certificates. Specify BYOC when you want to bring your own certificate. CertificateGenerationType RotateAutonomousVmClusterOrdsCertsDetailsCertificateGenerationTypeEnum `mandatory:"true" json:"certificateGenerationType"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate to use. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ssl_certs_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ssl_certs_details.go index f1301a8ff18..6331df44266 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ssl_certs_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_autonomous_vm_cluster_ssl_certs_details.go @@ -15,10 +15,10 @@ import ( "strings" ) -// RotateAutonomousVmClusterSslCertsDetails The details for configuring the ORDS certificates on Autonomous VM Cluster +// RotateAutonomousVmClusterSslCertsDetails Details for configuring the ORDS certificates on Autonomous Exadata VM Cluster type RotateAutonomousVmClusterSslCertsDetails struct { - // Specify SYSTEM for using Oracle managed certificates. Specify BYOC when you want to bring your own certificate. + // Specify SYSTEM to use Oracle-managed certificates. Specify BYOC when you want to bring your own certificate. CertificateGenerationType RotateAutonomousVmClusterSslCertsDetailsCertificateGenerationTypeEnum `mandatory:"true" json:"certificateGenerationType"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate to use. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ords_certs_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ords_certs_details.go index d3662725e17..4a0ec42467d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ords_certs_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ords_certs_details.go @@ -18,7 +18,7 @@ import ( // RotateCloudAutonomousVmClusterOrdsCertsDetails The details for configuring the ORDS certificates on Cloud Autonomous VM Cluster type RotateCloudAutonomousVmClusterOrdsCertsDetails struct { - // Specify SYSTEM for using Oracle managed certificates. Specify BYOC when you want to bring your own certificate. + // Specify SYSTEM to use Oracle-managed certificates. Specify BYOC when you want to bring your own certificate. CertificateGenerationType RotateCloudAutonomousVmClusterOrdsCertsDetailsCertificateGenerationTypeEnum `mandatory:"true" json:"certificateGenerationType"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate to use. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ssl_certs_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ssl_certs_details.go index ee5df85d5b0..3ecb4e5e086 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ssl_certs_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/rotate_cloud_autonomous_vm_cluster_ssl_certs_details.go @@ -18,7 +18,7 @@ import ( // RotateCloudAutonomousVmClusterSslCertsDetails The details for configuring the SSL certificates on Cloud Autonomous VM Cluster type RotateCloudAutonomousVmClusterSslCertsDetails struct { - // Specify SYSTEM for using Oracle managed certificates. Specify BYOC when you want to bring your own certificate. + // Specify SYSTEM to use Oracle-managed certificates. Specify BYOC when you want to bring your own certificate. CertificateGenerationType RotateCloudAutonomousVmClusterSslCertsDetailsCertificateGenerationTypeEnum `mandatory:"true" json:"certificateGenerationType"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate to use. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster.go index 900028ad930..10bfd818a32 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster.go @@ -90,6 +90,9 @@ type VmCluster struct { // The list of Db server. DbServers []string `mandatory:"false" json:"dbServers"` + // The name of the availability domain that the VM cluster is located in. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster_summary.go index c23176188a4..5aba73f1b6d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/vm_cluster_summary.go @@ -90,6 +90,9 @@ type VmClusterSummary struct { // The list of Db server. DbServers []string `mandatory:"false" json:"dbServers"` + // The name of the availability domain that the VM cluster is located in. + AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_details.go index 0b92b46a629..ef672b7e435 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_details.go @@ -46,6 +46,10 @@ type CreateZoneDetails struct { // required parameter when the `zoneType` value is `SECONDARY`. ExternalMasters []ExternalMaster `mandatory:"false" json:"externalMasters"` + // External secondary servers for the zone. + // This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + ExternalDownstreams []ExternalDownstream `mandatory:"false" json:"externalDownstreams"` + // The type of the zone. Must be either `PRIMARY` or `SECONDARY`. `SECONDARY` is only supported for GLOBAL // zones. ZoneType CreateZoneDetailsZoneTypeEnum `mandatory:"false" json:"zoneType,omitempty"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_from_zone_file_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_from_zone_file_request_response.go new file mode 100644 index 00000000000..f0ab9ac1011 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dns/create_zone_from_zone_file_request_response.go @@ -0,0 +1,161 @@ +// 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 dns + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// CreateZoneFromZoneFileRequest wrapper for the CreateZoneFromZoneFile operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateZoneFromZoneFile.go.html to see an example of how to use CreateZoneFromZoneFileRequest. +type CreateZoneFromZoneFileRequest struct { + + // The OCID of the compartment the resource belongs to. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The zone file contents. + CreateZoneFromZoneFileDetails io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // Unique Oracle-assigned identifier for the request. If you need + // to contact Oracle about a particular request, please provide + // the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Specifies to operate only on resources that have a matching DNS scope. + Scope CreateZoneFromZoneFileScopeEnum `mandatory:"false" contributesTo:"query" name:"scope" omitEmpty:"true"` + + // The OCID of the view the resource is associated with. + ViewId *string `mandatory:"false" contributesTo:"query" name:"viewId"` + + // 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 CreateZoneFromZoneFileRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateZoneFromZoneFileRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateZoneFromZoneFileRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.CreateZoneFromZoneFileDetails) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateZoneFromZoneFileRequest) 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 CreateZoneFromZoneFileRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCreateZoneFromZoneFileScopeEnum(string(request.Scope)); !ok && request.Scope != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Scope: %s. Supported values are: %s.", request.Scope, strings.Join(GetCreateZoneFromZoneFileScopeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateZoneFromZoneFileResponse wrapper for the CreateZoneFromZoneFile operation +type CreateZoneFromZoneFileResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Zone instance + Zone `presentIn:"body"` + + // The current version of the resource, ending with a + // representation-specific suffix. This value may be used in If-Match + // and If-None-Match headers for later requests of the same resource. + Etag *string `presentIn:"header" name:"etag"` + + // The full URI of the resource related to the request. + Location *string `presentIn:"header" name:"location"` + + // 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"` + + // 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"` +} + +func (response CreateZoneFromZoneFileResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateZoneFromZoneFileResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// CreateZoneFromZoneFileScopeEnum Enum with underlying type: string +type CreateZoneFromZoneFileScopeEnum string + +// Set of constants representing the allowable values for CreateZoneFromZoneFileScopeEnum +const ( + CreateZoneFromZoneFileScopeGlobal CreateZoneFromZoneFileScopeEnum = "GLOBAL" + CreateZoneFromZoneFileScopePrivate CreateZoneFromZoneFileScopeEnum = "PRIVATE" +) + +var mappingCreateZoneFromZoneFileScopeEnum = map[string]CreateZoneFromZoneFileScopeEnum{ + "GLOBAL": CreateZoneFromZoneFileScopeGlobal, + "PRIVATE": CreateZoneFromZoneFileScopePrivate, +} + +var mappingCreateZoneFromZoneFileScopeEnumLowerCase = map[string]CreateZoneFromZoneFileScopeEnum{ + "global": CreateZoneFromZoneFileScopeGlobal, + "private": CreateZoneFromZoneFileScopePrivate, +} + +// GetCreateZoneFromZoneFileScopeEnumValues Enumerates the set of values for CreateZoneFromZoneFileScopeEnum +func GetCreateZoneFromZoneFileScopeEnumValues() []CreateZoneFromZoneFileScopeEnum { + values := make([]CreateZoneFromZoneFileScopeEnum, 0) + for _, v := range mappingCreateZoneFromZoneFileScopeEnum { + values = append(values, v) + } + return values +} + +// GetCreateZoneFromZoneFileScopeEnumStringValues Enumerates the set of values in String for CreateZoneFromZoneFileScopeEnum +func GetCreateZoneFromZoneFileScopeEnumStringValues() []string { + return []string{ + "GLOBAL", + "PRIVATE", + } +} + +// GetMappingCreateZoneFromZoneFileScopeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateZoneFromZoneFileScopeEnum(val string) (CreateZoneFromZoneFileScopeEnum, bool) { + enum, ok := mappingCreateZoneFromZoneFileScopeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/dns/dns_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/dns/dns_client.go index 516586d055b..c29ca216fe6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/dns/dns_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dns/dns_client.go @@ -786,6 +786,63 @@ func (client DnsClient) createZone(ctx context.Context, request common.OCIReques return response, err } +// CreateZoneFromZoneFile Creates a new zone from a zone file in the specified compartment. Not supported for private zones. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/dns/CreateZoneFromZoneFile.go.html to see an example of how to use CreateZoneFromZoneFile API. +func (client DnsClient) CreateZoneFromZoneFile(ctx context.Context, request CreateZoneFromZoneFileRequest) (response CreateZoneFromZoneFileResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.createZoneFromZoneFile, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateZoneFromZoneFileResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateZoneFromZoneFileResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateZoneFromZoneFileResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateZoneFromZoneFileResponse") + } + return +} + +// createZoneFromZoneFile implements the OCIOperation interface (enables retrying operations) +func (client DnsClient) createZoneFromZoneFile(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/actions/createZoneFromZoneFile", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateZoneFromZoneFileResponse + 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/dns/20180115/Zone/CreateZoneFromZoneFile" + err = common.PostProcessServiceError(err, "Dns", "CreateZoneFromZoneFile", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteDomainRecords Deletes all records at the specified zone and domain. // When the zone name is provided as a path parameter and `PRIVATE` is used for the scope query parameter // then the viewId query parameter is required. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/dns/external_downstream.go b/vendor/github.com/oracle/oci-go-sdk/v65/dns/external_downstream.go new file mode 100644 index 00000000000..7e941b1ee76 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dns/external_downstream.go @@ -0,0 +1,49 @@ +// 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. + +// DNS API +// +// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources. +// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm). +// + +package dns + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalDownstream External downstream nameserver for the zone. +// This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. +type ExternalDownstream struct { + + // The server's IP address (IPv4 or IPv6). + Address *string `mandatory:"true" json:"address"` + + // The server's port. Port value must be a value of 53, otherwise omit + // the port value. + Port *int `mandatory:"false" json:"port"` + + // The OCID of the TSIG key. + // A TSIG key is used to secure DNS messages (in this case, zone transfers) between two systems that both have the (shared) secret. + TsigKeyId *string `mandatory:"false" json:"tsigKeyId"` +} + +func (m ExternalDownstream) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ExternalDownstream) 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/dns/update_zone_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/dns/update_zone_details.go index 199c703197f..d5e0b28bfa7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/dns/update_zone_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dns/update_zone_details.go @@ -35,6 +35,10 @@ type UpdateZoneDetails struct { // External master servers for the zone. `externalMasters` becomes a // required parameter when the `zoneType` value is `SECONDARY`. ExternalMasters []ExternalMaster `mandatory:"false" json:"externalMasters"` + + // External secondary servers for the zone. + // This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + ExternalDownstreams []ExternalDownstream `mandatory:"false" json:"externalDownstreams"` } func (m UpdateZoneDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/dns/zone.go b/vendor/github.com/oracle/oci-go-sdk/v65/dns/zone.go index 8c720df986b..95f76095ab5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/dns/zone.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dns/zone.go @@ -48,6 +48,10 @@ type Zone struct { // required parameter when the `zoneType` value is `SECONDARY`. ExternalMasters []ExternalMaster `mandatory:"true" json:"externalMasters"` + // External secondary servers for the zone. + // This field is currently not supported when `zoneType` is `SECONDARY` or `scope` is `PRIVATE`. + ExternalDownstreams []ExternalDownstream `mandatory:"true" json:"externalDownstreams"` + // The canonical absolute URL of the resource. Self *string `mandatory:"true" json:"self"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/action_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/action_types.go index 365168a108b..e47b757d010 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/action_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/action_types.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/archiving.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/archiving.go index 34629a4115c..97436de8a75 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/archiving.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/archiving.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -18,7 +21,7 @@ import ( // Archiving Log archiving configuration. type Archiving struct { - // True if archiving enabled. This field is now decrecated, you should use cloud flow to enable archiving. + // True if archiving enabled. This field is now deprecated, you should use Service Connector Hub to enable archiving. IsEnabled *bool `mandatory:"false" json:"isEnabled"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/category.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/category.go index c6e1ef22306..2926c6e5132 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/category.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/category.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -21,7 +24,7 @@ type Category struct { // Category name. Name *string `mandatory:"false" json:"name"` - // Category display name. + // Category display name. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Parameters the category supports. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_group_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_group_compartment_details.go index 37d48b5811b..8acc24edc08 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_group_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_group_compartment_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_log_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_log_group_details.go index f5102019883..4ba295260d5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_log_group_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_log_group_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_details.go index 7bda5ad04dd..f3caec042fc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -15,7 +18,7 @@ import ( "strings" ) -// ChangeLogSavedSearchCompartmentDetails Contains details indicating which compartment the resource should move to +// ChangeLogSavedSearchCompartmentDetails Contains details indicating which compartment the resource should move to. type ChangeLogSavedSearchCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment into which the resource should be moved. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_request_response.go index 951deef59a7..4db572a0c37 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_log_saved_search_compartment_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/ChangeLogSavedSearchCompartment.go.html to see an example of how to use ChangeLogSavedSearchCompartmentRequest. type ChangeLogSavedSearchCompartmentRequest struct { - // OCID of the logSavedSearch + // OCID of the logSavedSearch. LogSavedSearchId *string `mandatory:"true" contributesTo:"path" name:"logSavedSearchId"` // Contains details indicating which compartment the resource should move to. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_unified_agent_configuration_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_unified_agent_configuration_compartment_details.go index abf76ab5bd5..568219df507 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_unified_agent_configuration_compartment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/change_unified_agent_configuration_compartment_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/configuration.go index d531bbca767..7b10acaaa3d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/configuration.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_details.go index af3425777f2..01e0ab919a0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -40,7 +43,7 @@ type CreateLogDetails struct { Configuration *Configuration `mandatory:"false" json:"configuration"` - // Log retention duration in 30-day increments (30, 60, 90 and so on). + // Log retention duration in 30-day increments (30, 60, 90 and so on until 180). RetentionDuration *int `mandatory:"false" json:"retentionDuration"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_group_details.go index 69e58010ec1..30a5c0f2eca 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_group_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_group_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_details.go index 59797d721ce..b6e5dceb35a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -15,7 +18,7 @@ import ( "strings" ) -// CreateLogSavedSearchDetails A log saved search that can be used to save and share a given search result. +// CreateLogSavedSearchDetails A LogSavedSearch that can be used to save and share a given search result. type CreateLogSavedSearchDetails struct { // The OCID of the compartment that the resource belongs to. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_request_response.go index 8371bc2513d..9d7d512e14a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_log_saved_search_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/CreateLogSavedSearch.go.html to see an example of how to use CreateLogSavedSearchRequest. type CreateLogSavedSearchRequest struct { - // Specification of the Saved Search to create + // Specification of the saved search to create. CreateLogSavedSearchDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_unified_agent_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_unified_agent_configuration_details.go index fe6c4e1d1b9..a55ebd685e3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_unified_agent_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/create_unified_agent_configuration_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/delete_log_saved_search_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/delete_log_saved_search_request_response.go index c769cee4456..ac8d149f5a0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/delete_log_saved_search_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/delete_log_saved_search_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/DeleteLogSavedSearch.go.html to see an example of how to use DeleteLogSavedSearchRequest. type DeleteLogSavedSearchRequest struct { - // OCID of the logSavedSearch + // OCID of the logSavedSearch. LogSavedSearchId *string `mandatory:"true" contributesTo:"path" name:"logSavedSearchId"` // For optimistic concurrency control. In the PUT or DELETE call for a diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/get_log_saved_search_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/get_log_saved_search_request_response.go index 5b65539ee2e..2679788bb61 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/get_log_saved_search_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/get_log_saved_search_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/GetLogSavedSearch.go.html to see an example of how to use GetLogSavedSearchRequest. type GetLogSavedSearchRequest struct { - // OCID of the logSavedSearch + // OCID of the logSavedSearch. LogSavedSearchId *string `mandatory:"true" contributesTo:"path" name:"logSavedSearchId"` // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/grok_pattern.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/grok_pattern.go index c3d440d0cb6..6815dd8823a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/grok_pattern.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/grok_pattern.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/group_association_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/group_association_details.go index e606e34a540..4903a3301a8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/group_association_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/group_association_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_groups_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_groups_request_response.go index 2a771d0f2be..ed6440e0b4c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_groups_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_groups_request_response.go @@ -25,7 +25,7 @@ type ListLogGroupsRequest struct { // Specifies whether or not nested compartments should be traversed. Defaults to false. IsCompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"isCompartmentIdInSubtree"` - // Resource name + // Resource name. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // For list pagination. The value of the `opc-next-page` or `opc-previous-page` response header from the previous "List" call. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_included_searches_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_included_searches_request_response.go deleted file mode 100644 index bf528d43e1d..00000000000 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_included_searches_request_response.go +++ /dev/null @@ -1,212 +0,0 @@ -// 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 logging - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "net/http" - "strings" -) - -// ListLogIncludedSearchesRequest wrapper for the ListLogIncludedSearches operation -// -// See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/ListLogIncludedSearches.go.html to see an example of how to use ListLogIncludedSearchesRequest. -type ListLogIncludedSearchesRequest struct { - - // Compartment OCID to list resources in. See compartmentIdInSubtree - // for nested compartments traversal. - CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - - // OCID of the LogIncludedSearch - LogIncludedSearchId *string `mandatory:"false" contributesTo:"query" name:"logIncludedSearchId"` - - // Resource name - DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` - - // For list pagination. The value of the `opc-next-page` or `opc-previous-page` response header from the previous "List" call. - // For important details about how pagination works, see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). - Page *string `mandatory:"false" contributesTo:"query" name:"page"` - - // The maximum number of items to return in a paginated "List" call. - Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` - - // The field to sort by (one column only). Default sort order is - // ascending exception of `timeCreated` and `timeLastModified` columns (descending). - SortBy ListLogIncludedSearchesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` - - // The sort order to use, whether 'asc' or 'desc'. - SortOrder ListLogIncludedSearchesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` - - // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about - // a particular request, please provide the request ID. - 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 ListLogIncludedSearchesRequest) String() string { - return common.PointerString(request) -} - -// HTTPRequest implements the OCIRequest interface -func (request ListLogIncludedSearchesRequest) 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 ListLogIncludedSearchesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { - - return nil, false - -} - -// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. -func (request ListLogIncludedSearchesRequest) 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 ListLogIncludedSearchesRequest) ValidateEnumValue() (bool, error) { - errMessage := []string{} - if _, ok := GetMappingListLogIncludedSearchesSortByEnum(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(GetListLogIncludedSearchesSortByEnumStringValues(), ","))) - } - if _, ok := GetMappingListLogIncludedSearchesSortOrderEnum(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(GetListLogIncludedSearchesSortOrderEnumStringValues(), ","))) - } - if len(errMessage) > 0 { - return true, fmt.Errorf(strings.Join(errMessage, "\n")) - } - return false, nil -} - -// ListLogIncludedSearchesResponse wrapper for the ListLogIncludedSearches operation -type ListLogIncludedSearchesResponse struct { - - // The underlying http response - RawResponse *http.Response - - // A list of LogIncludedSearchSummaryCollection instances - LogIncludedSearchSummaryCollection `presentIn:"body"` - - // For list pagination. When this header appears in the response, additional pages - // of results remain. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). - OpcNextPage *string `presentIn:"header" name:"opc-next-page"` - - // For list pagination. When this header appears in the response, previous pages - // of results exist. For important details about how pagination works, see - // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). - OpcPreviousPage *string `presentIn:"header" name:"opc-previous-page"` - - // Unique Oracle-assigned identifier for the request. If you need to contact - // Oracle about a particular request, please provide the request ID. - OpcRequestId *string `presentIn:"header" name:"opc-request-id"` -} - -func (response ListLogIncludedSearchesResponse) String() string { - return common.PointerString(response) -} - -// HTTPResponse implements the OCIResponse interface -func (response ListLogIncludedSearchesResponse) HTTPResponse() *http.Response { - return response.RawResponse -} - -// ListLogIncludedSearchesSortByEnum Enum with underlying type: string -type ListLogIncludedSearchesSortByEnum string - -// Set of constants representing the allowable values for ListLogIncludedSearchesSortByEnum -const ( - ListLogIncludedSearchesSortByTimecreated ListLogIncludedSearchesSortByEnum = "timeCreated" - ListLogIncludedSearchesSortByDisplayname ListLogIncludedSearchesSortByEnum = "displayName" -) - -var mappingListLogIncludedSearchesSortByEnum = map[string]ListLogIncludedSearchesSortByEnum{ - "timeCreated": ListLogIncludedSearchesSortByTimecreated, - "displayName": ListLogIncludedSearchesSortByDisplayname, -} - -var mappingListLogIncludedSearchesSortByEnumLowerCase = map[string]ListLogIncludedSearchesSortByEnum{ - "timecreated": ListLogIncludedSearchesSortByTimecreated, - "displayname": ListLogIncludedSearchesSortByDisplayname, -} - -// GetListLogIncludedSearchesSortByEnumValues Enumerates the set of values for ListLogIncludedSearchesSortByEnum -func GetListLogIncludedSearchesSortByEnumValues() []ListLogIncludedSearchesSortByEnum { - values := make([]ListLogIncludedSearchesSortByEnum, 0) - for _, v := range mappingListLogIncludedSearchesSortByEnum { - values = append(values, v) - } - return values -} - -// GetListLogIncludedSearchesSortByEnumStringValues Enumerates the set of values in String for ListLogIncludedSearchesSortByEnum -func GetListLogIncludedSearchesSortByEnumStringValues() []string { - return []string{ - "timeCreated", - "displayName", - } -} - -// GetMappingListLogIncludedSearchesSortByEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListLogIncludedSearchesSortByEnum(val string) (ListLogIncludedSearchesSortByEnum, bool) { - enum, ok := mappingListLogIncludedSearchesSortByEnumLowerCase[strings.ToLower(val)] - return enum, ok -} - -// ListLogIncludedSearchesSortOrderEnum Enum with underlying type: string -type ListLogIncludedSearchesSortOrderEnum string - -// Set of constants representing the allowable values for ListLogIncludedSearchesSortOrderEnum -const ( - ListLogIncludedSearchesSortOrderAsc ListLogIncludedSearchesSortOrderEnum = "ASC" - ListLogIncludedSearchesSortOrderDesc ListLogIncludedSearchesSortOrderEnum = "DESC" -) - -var mappingListLogIncludedSearchesSortOrderEnum = map[string]ListLogIncludedSearchesSortOrderEnum{ - "ASC": ListLogIncludedSearchesSortOrderAsc, - "DESC": ListLogIncludedSearchesSortOrderDesc, -} - -var mappingListLogIncludedSearchesSortOrderEnumLowerCase = map[string]ListLogIncludedSearchesSortOrderEnum{ - "asc": ListLogIncludedSearchesSortOrderAsc, - "desc": ListLogIncludedSearchesSortOrderDesc, -} - -// GetListLogIncludedSearchesSortOrderEnumValues Enumerates the set of values for ListLogIncludedSearchesSortOrderEnum -func GetListLogIncludedSearchesSortOrderEnumValues() []ListLogIncludedSearchesSortOrderEnum { - values := make([]ListLogIncludedSearchesSortOrderEnum, 0) - for _, v := range mappingListLogIncludedSearchesSortOrderEnum { - values = append(values, v) - } - return values -} - -// GetListLogIncludedSearchesSortOrderEnumStringValues Enumerates the set of values in String for ListLogIncludedSearchesSortOrderEnum -func GetListLogIncludedSearchesSortOrderEnumStringValues() []string { - return []string{ - "ASC", - "DESC", - } -} - -// GetMappingListLogIncludedSearchesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum -func GetMappingListLogIncludedSearchesSortOrderEnum(val string) (ListLogIncludedSearchesSortOrderEnum, bool) { - enum, ok := mappingListLogIncludedSearchesSortOrderEnumLowerCase[strings.ToLower(val)] - return enum, ok -} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_saved_searches_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_saved_searches_request_response.go index cfe0626d83e..ba5e2c3f940 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_saved_searches_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_log_saved_searches_request_response.go @@ -22,10 +22,10 @@ type ListLogSavedSearchesRequest struct { // for nested compartments traversal. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` - // OCID of the LogSavedSearch + // OCID of the LogSavedSearch. LogSavedSearchId *string `mandatory:"false" contributesTo:"query" name:"logSavedSearchId"` - // Resource name + // Resource name. Name *string `mandatory:"false" contributesTo:"query" name:"name"` // For list pagination. The value of the `opc-next-page` or `opc-previous-page` response header from the previous "List" call. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_logs_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_logs_request_response.go index 153f9c90ab1..a44f0cf7497 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_logs_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_logs_request_response.go @@ -24,13 +24,13 @@ type ListLogsRequest struct { // The logType that the log object is for, whether custom or service. LogType ListLogsLogTypeEnum `mandatory:"false" contributesTo:"query" name:"logType" omitEmpty:"true"` - // Service that created the log object. + // Service that created the log object, which is a field of LogSummary.Configuration.Source. SourceService *string `mandatory:"false" contributesTo:"query" name:"sourceService"` - // Log object resource. + // Log object resource, which is a field of LogSummary.Configuration.Source. SourceResource *string `mandatory:"false" contributesTo:"query" name:"sourceResource"` - // Resource name + // Resource name. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // Lifecycle state of the log object diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_services_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_services_request_response.go index 6bb77f01934..4e6988804d5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_services_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_services_request_response.go @@ -18,6 +18,9 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/ListServices.go.html to see an example of how to use ListServicesRequest. type ListServicesRequest struct { + // Service stage of a service. The allowed values are "ProductionStage", "DevStage" and "LAStage". + ServiceStage *string `mandatory:"false" contributesTo:"query" name:"serviceStage"` + // 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"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_unified_agent_configurations_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_unified_agent_configurations_request_response.go index 50c45a88a85..cf033830116 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_unified_agent_configurations_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/list_unified_agent_configurations_request_response.go @@ -31,7 +31,7 @@ type ListUnifiedAgentConfigurationsRequest struct { // The OCID of a group or a dynamic group. GroupId *string `mandatory:"false" contributesTo:"query" name:"groupId"` - // Resource name + // Resource name. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // Lifecycle state of the log object diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log.go index 28d2921360e..74bd32ccd1b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -58,7 +61,7 @@ type Log struct { // Time the resource was last modified. TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` - // Log retention duration in 30-day increments (30, 60, 90 and so on). + // Log retention duration in 30-day increments (30, 60, 90 and so on until 180). RetentionDuration *int `mandatory:"false" json:"retentionDuration"` // The OCID of the compartment that the resource belongs to. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group.go index e424f4cf19a..2c1d5c9c3ae 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_lifecycle_state.go index 22f26325dd9..946c6e4e636 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_lifecycle_state.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_lifecycle_state.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_summary.go index 72fe1dd66dd..bf6924f7c17 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_group_summary.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search.go deleted file mode 100644 index 2f79d0c905d..00000000000 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search.go +++ /dev/null @@ -1,65 +0,0 @@ -// 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. - -// Logging Management API -// -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. -// - -package logging - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "strings" -) - -// LogIncludedSearch A search provided by OCI that serves common customer needs. -type LogIncludedSearch struct { - - // The OCID of the resource. - Id *string `mandatory:"true" json:"id"` - - // The user-friendly display name. This must be unique within the enclosing resource, - // and it's changeable. Avoid entering confidential information. - DisplayName *string `mandatory:"true" json:"displayName"` - - // The search query that is saved. - Query *string `mandatory:"true" json:"query"` - - // Time the resource was created. - TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` - - // Time the resource was last modified. - TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` - - // Description for this resource. - Description *string `mandatory:"false" json:"description"` - - // Defined tags for this resource. Each key is predefined and scoped to a - // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). - // Example: `{"Operations": {"CostCenter": "42"}}` - DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` - - // Free-form tags for this resource. Each tag is a simple key-value pair with no - // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). - // Example: `{"Department": "Finance"}` - FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` -} - -func (m LogIncludedSearch) String() string { - return common.PointerString(m) -} - -// ValidateEnumValue returns an error when providing an unsupported enum value -// This function is being called during constructing API request process -// Not recommended for calling this function directly -func (m LogIncludedSearch) 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/logging/log_included_search_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search_summary_collection.go deleted file mode 100644 index 55e858cf5fe..00000000000 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_included_search_summary_collection.go +++ /dev/null @@ -1,39 +0,0 @@ -// 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. - -// Logging Management API -// -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. -// - -package logging - -import ( - "fmt" - "github.com/oracle/oci-go-sdk/v65/common" - "strings" -) - -// LogIncludedSearchSummaryCollection A set of LogIncludedSummary -type LogIncludedSearchSummaryCollection struct { - - // The list of summaries - Items []LogIncludedSearchSummary `mandatory:"true" json:"items"` -} - -func (m LogIncludedSearchSummaryCollection) String() string { - return common.PointerString(m) -} - -// ValidateEnumValue returns an error when providing an unsupported enum value -// This function is being called during constructing API request process -// Not recommended for calling this function directly -func (m LogIncludedSearchSummaryCollection) 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/logging/log_lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_lifecycle_state.go index 029ff5f0888..8573c878ebc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_lifecycle_state.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_lifecycle_state.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search.go index 9dbf7ee703b..126a77440cd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -15,7 +18,7 @@ import ( "strings" ) -// LogSavedSearch A log saved search that can be used to save and share a given search result. +// LogSavedSearch A LogSavedSearch that can be used to save and share a given search result. type LogSavedSearch struct { // The OCID of the resource. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_lifecycle_state.go index f5bf2b6d9e5..d3a2586eadd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_lifecycle_state.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_lifecycle_state.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary.go index 6d9cab0ebe2..e57d0bfe717 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -15,7 +18,7 @@ import ( "strings" ) -// LogSavedSearchSummary A summary of a log saved search that can be used to save and share a given search result. +// LogSavedSearchSummary A summary of a LogSavedSearch that can be used to save and share a given search result. type LogSavedSearchSummary struct { // The OCID of the resource. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary_collection.go index e93d4e68417..bf9cc83f49a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_saved_search_summary_collection.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_summary.go index 9cf3db3c5a7..a01e711220b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/log_summary.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -55,7 +58,7 @@ type LogSummary struct { // Time the resource was last modified. TimeLastModified *common.SDKTime `mandatory:"false" json:"timeLastModified"` - // Log retention duration in 30-day increments (30, 60, 90 and so on). + // Log retention duration in 30-day increments (30, 60, 90 and so on until 180). RetentionDuration *int `mandatory:"false" json:"retentionDuration"` // The OCID of the compartment that the resource belongs to. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/logging_loggingmanagement_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/logging_loggingmanagement_client.go index 146e51c6622..02cc8c8a3b7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/logging_loggingmanagement_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/logging_loggingmanagement_client.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -692,7 +695,7 @@ func (client LoggingManagementClient) deleteLogGroup(ctx context.Context, reques return response, err } -// DeleteLogSavedSearch Deletes the specified log saved search. +// DeleteLogSavedSearch Deletes the specified LogSavedSearch. // // See also // @@ -977,64 +980,7 @@ func (client LoggingManagementClient) getLogGroup(ctx context.Context, request c return response, err } -// GetLogIncludedSearch Retrieves a LogIncludedSearch. -// -// See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/GetLogIncludedSearch.go.html to see an example of how to use GetLogIncludedSearch API. -func (client LoggingManagementClient) GetLogIncludedSearch(ctx context.Context, request GetLogIncludedSearchRequest) (response GetLogIncludedSearchResponse, err error) { - var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() - if client.RetryPolicy() != nil { - policy = *client.RetryPolicy() - } - if request.RetryPolicy() != nil { - policy = *request.RetryPolicy() - } - ociResponse, err = common.Retry(ctx, request, client.getLogIncludedSearch, policy) - if err != nil { - if ociResponse != nil { - if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { - opcRequestId := httpResponse.Header.Get("opc-request-id") - response = GetLogIncludedSearchResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} - } else { - response = GetLogIncludedSearchResponse{} - } - } - return - } - if convertedResponse, ok := ociResponse.(GetLogIncludedSearchResponse); ok { - response = convertedResponse - } else { - err = fmt.Errorf("failed to convert OCIResponse into GetLogIncludedSearchResponse") - } - return -} - -// getLogIncludedSearch implements the OCIOperation interface (enables retrying operations) -func (client LoggingManagementClient) getLogIncludedSearch(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - - httpRequest, err := request.HTTPRequest(http.MethodGet, "/logIncludedSearch/{logIncludedSearchId}", binaryReqBody, extraHeaders) - if err != nil { - return nil, err - } - - var response GetLogIncludedSearchResponse - 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/logging-management/20200531/LogIncludedSearch/GetLogIncludedSearch" - err = common.PostProcessServiceError(err, "LoggingManagement", "GetLogIncludedSearch", apiReferenceLink) - return response, err - } - - err = common.UnmarshalResponse(httpResponse, &response) - return response, err -} - -// GetLogSavedSearch Retrieves a log saved search. +// GetLogSavedSearch Retrieves a LogSavedSearch. // // See also // @@ -1262,64 +1208,7 @@ func (client LoggingManagementClient) listLogGroups(ctx context.Context, request return response, err } -// ListLogIncludedSearches Lists Logging Included Searches for this compartment. -// -// See also -// -// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/ListLogIncludedSearches.go.html to see an example of how to use ListLogIncludedSearches API. -func (client LoggingManagementClient) ListLogIncludedSearches(ctx context.Context, request ListLogIncludedSearchesRequest) (response ListLogIncludedSearchesResponse, err error) { - var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() - if client.RetryPolicy() != nil { - policy = *client.RetryPolicy() - } - if request.RetryPolicy() != nil { - policy = *request.RetryPolicy() - } - ociResponse, err = common.Retry(ctx, request, client.listLogIncludedSearches, policy) - if err != nil { - if ociResponse != nil { - if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { - opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListLogIncludedSearchesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} - } else { - response = ListLogIncludedSearchesResponse{} - } - } - return - } - if convertedResponse, ok := ociResponse.(ListLogIncludedSearchesResponse); ok { - response = convertedResponse - } else { - err = fmt.Errorf("failed to convert OCIResponse into ListLogIncludedSearchesResponse") - } - return -} - -// listLogIncludedSearches implements the OCIOperation interface (enables retrying operations) -func (client LoggingManagementClient) listLogIncludedSearches(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - - httpRequest, err := request.HTTPRequest(http.MethodGet, "/logIncludedSearches", binaryReqBody, extraHeaders) - if err != nil { - return nil, err - } - - var response ListLogIncludedSearchesResponse - 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/logging-management/20200531/LogIncludedSearch/ListLogIncludedSearches" - err = common.PostProcessServiceError(err, "LoggingManagement", "ListLogIncludedSearches", apiReferenceLink) - return response, err - } - - err = common.UnmarshalResponse(httpResponse, &response) - return response, err -} - -// ListLogSavedSearches Lists Logging Saved Searches for this compartment. +// ListLogSavedSearches Lists LogSavedSearches for this compartment. // // See also // @@ -1834,7 +1723,7 @@ func (client LoggingManagementClient) updateLogGroup(ctx context.Context, reques return response, err } -// UpdateLogSavedSearch Updates an existing log saved search. +// UpdateLogSavedSearch Updates an existing LogSavedSearch. // // See also // diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/oci_service.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/oci_service.go index 8db4ec4efa9..bacad7a3190 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/oci_service.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/oci_service.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_status.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_status.go index cc4cef65217..d128d1c5ad1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_status.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_status.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_types.go index d6d220d077b..c890ee4e472 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/operation_types.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/parameter.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/parameter.go index 94a37a86080..1d514fe88f7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/parameter.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/parameter.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -21,9 +24,16 @@ type Parameter struct { // Parameter name. Name *string `mandatory:"true" json:"name"` - // Parameter type. One of integer, string, boolean. + // Parameter type. Type ParameterTypeEnum `mandatory:"true" json:"type"` + // The user-friendly display name. This must be unique within the enclosing resource, + // and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Parameter rqsType if applicable. + RqsType *string `mandatory:"false" json:"rqsType"` + // Java regex pattern to validate a parameter value. Pattern *string `mandatory:"false" json:"pattern"` } @@ -52,21 +62,27 @@ type ParameterTypeEnum string // Set of constants representing the allowable values for ParameterTypeEnum const ( - ParameterTypeInteger ParameterTypeEnum = "integer" - ParameterTypeString ParameterTypeEnum = "string" - ParameterTypeBoolean ParameterTypeEnum = "boolean" + ParameterTypeInteger ParameterTypeEnum = "integer" + ParameterTypeString ParameterTypeEnum = "string" + ParameterTypeBoolean ParameterTypeEnum = "boolean" + ParameterTypeEnumString ParameterTypeEnum = "ENUM_STRING" + ParameterTypeRqsFilter ParameterTypeEnum = "RQS_FILTER" ) var mappingParameterTypeEnum = map[string]ParameterTypeEnum{ - "integer": ParameterTypeInteger, - "string": ParameterTypeString, - "boolean": ParameterTypeBoolean, + "integer": ParameterTypeInteger, + "string": ParameterTypeString, + "boolean": ParameterTypeBoolean, + "ENUM_STRING": ParameterTypeEnumString, + "RQS_FILTER": ParameterTypeRqsFilter, } var mappingParameterTypeEnumLowerCase = map[string]ParameterTypeEnum{ - "integer": ParameterTypeInteger, - "string": ParameterTypeString, - "boolean": ParameterTypeBoolean, + "integer": ParameterTypeInteger, + "string": ParameterTypeString, + "boolean": ParameterTypeBoolean, + "enum_string": ParameterTypeEnumString, + "rqs_filter": ParameterTypeRqsFilter, } // GetParameterTypeEnumValues Enumerates the set of values for ParameterTypeEnum @@ -84,6 +100,8 @@ func GetParameterTypeEnumStringValues() []string { "integer", "string", "boolean", + "ENUM_STRING", + "RQS_FILTER", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/resource_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/resource_type.go index 61298cf6e97..e6992f1b9c1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/resource_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/resource_type.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/service_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/service_summary.go index 511bf419bf0..1344c64ff32 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/service_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/service_summary.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/source.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/source.go index 56c5146c25d..e24f52d464f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/source.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/source.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/source_update_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/source_update_details.go index 8f5da95b06a..97b348092df 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/source_update_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/source_update_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache2_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache2_parser.go index 9070815c79b..94c8ff0860c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache2_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache2_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentApache2Parser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache_error_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache_error_parser.go index 95faf0a4d6b..4ad060eb73b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache_error_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_apache_error_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentApacheErrorParser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_auditd_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_auditd_parser.go index 07e66ea0b2d..cbe908f37ac 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_auditd_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_auditd_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentAuditdParser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration.go index dfb2f7b9bdc..5f3ed2100ea 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_collection.go index 9e2aa599f28..18235f3a557 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_collection.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_summary.go index d4804e4fdb9..660d1e751af 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_configuration_summary.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_cri_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_cri_parser.go new file mode 100644 index 00000000000..d5845810bc3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_cri_parser.go @@ -0,0 +1,133 @@ +// 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. + +// Logging Management API +// +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). +// + +package logging + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UnifiedAgentCriParser CRI parser. +type UnifiedAgentCriParser struct { + + // Specify time field for the event time. If the event doesn't have this field, the current time is used. + FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` + + // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } + Types map[string]string `mandatory:"false" json:"types"` + + // Specify the null value pattern. + NullValuePattern *string `mandatory:"false" json:"nullValuePattern"` + + // If true, an empty string field is replaced with nil. + IsNullEmptyString *bool `mandatory:"false" json:"isNullEmptyString"` + + // If true, use Fluent::EventTime.now(current time) as a timestamp when time_key is specified. + IsEstimateCurrentEvent *bool `mandatory:"false" json:"isEstimateCurrentEvent"` + + // If true, keep time field in the record. + IsKeepTimeKey *bool `mandatory:"false" json:"isKeepTimeKey"` + + // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. + TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + + // If you don't need stream/logtag fields, set this to false. + IsMergeCriFields *bool `mandatory:"false" json:"isMergeCriFields"` + + // Optional nested JSON Parser for CRI Parser. Supported fields are fieldTimeKey, timeFormat, and isKeepTimeKey. + NestedParser *UnifiedJsonParser `mandatory:"false" json:"nestedParser"` +} + +//GetFieldTimeKey returns FieldTimeKey +func (m UnifiedAgentCriParser) GetFieldTimeKey() *string { + return m.FieldTimeKey +} + +//GetTypes returns Types +func (m UnifiedAgentCriParser) GetTypes() map[string]string { + return m.Types +} + +//GetNullValuePattern returns NullValuePattern +func (m UnifiedAgentCriParser) GetNullValuePattern() *string { + return m.NullValuePattern +} + +//GetIsNullEmptyString returns IsNullEmptyString +func (m UnifiedAgentCriParser) GetIsNullEmptyString() *bool { + return m.IsNullEmptyString +} + +//GetIsEstimateCurrentEvent returns IsEstimateCurrentEvent +func (m UnifiedAgentCriParser) GetIsEstimateCurrentEvent() *bool { + return m.IsEstimateCurrentEvent +} + +//GetIsKeepTimeKey returns IsKeepTimeKey +func (m UnifiedAgentCriParser) GetIsKeepTimeKey() *bool { + return m.IsKeepTimeKey +} + +//GetTimeoutInMilliseconds returns TimeoutInMilliseconds +func (m UnifiedAgentCriParser) GetTimeoutInMilliseconds() *int { + return m.TimeoutInMilliseconds +} + +func (m UnifiedAgentCriParser) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UnifiedAgentCriParser) 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 UnifiedAgentCriParser) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUnifiedAgentCriParser UnifiedAgentCriParser + s := struct { + DiscriminatorParam string `json:"parserType"` + MarshalTypeUnifiedAgentCriParser + }{ + "CRI", + (MarshalTypeUnifiedAgentCriParser)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_csv_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_csv_parser.go index 3177d240f8c..2cda6f95be8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_csv_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_csv_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -19,10 +22,30 @@ import ( // UnifiedAgentCsvParser CSV Parser. type UnifiedAgentCsvParser struct { + // csv keys. + Keys []string `mandatory:"true" json:"keys"` + // Specify time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,9 +63,8 @@ type UnifiedAgentCsvParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // csv delimiter. Delimiter *string `mandatory:"false" json:"delimiter"` - - Keys []string `mandatory:"false" json:"keys"` } //GetFieldTimeKey returns FieldTimeKey diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_grok_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_grok_parser.go index 4c5867a76d4..f4c874dd7e6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_grok_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_grok_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -19,10 +22,30 @@ import ( // UnifiedAgentGrokParser grok parser. type UnifiedAgentGrokParser struct { + // grok pattern object. + Patterns []GrokPattern `mandatory:"true" json:"patterns"` + // Specify time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,11 +63,11 @@ type UnifiedAgentGrokParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // grok name key. GrokNameKey *string `mandatory:"false" json:"grokNameKey"` + // grok failure key. GrokFailureKey *string `mandatory:"false" json:"grokFailureKey"` - - Patterns []GrokPattern `mandatory:"false" json:"patterns"` } //GetFieldTimeKey returns FieldTimeKey diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_configuration.go index 0d4063974a3..0d3ee60bced 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_configuration.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -18,9 +21,11 @@ import ( // UnifiedAgentLoggingConfiguration Unified Agent logging service configuration object. type UnifiedAgentLoggingConfiguration struct { - Sources []UnifiedAgentLoggingSource `mandatory:"false" json:"sources"` - Destination *UnifiedAgentLoggingDestination `mandatory:"false" json:"destination"` + // Logging source object. + Sources []UnifiedAgentLoggingSource `mandatory:"true" json:"sources"` + + Destination *UnifiedAgentLoggingDestination `mandatory:"true" json:"destination"` } func (m UnifiedAgentLoggingConfiguration) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_destination.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_destination.go index b0943b39680..f693309168d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_destination.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_destination.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_source.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_source.go index 495df0012c0..64abb9b364d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_source.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_logging_source.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_msgpack_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_msgpack_parser.go index 08892094265..d09bb006737 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_msgpack_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_msgpack_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentMsgpackParser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_grok_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_grok_parser.go index a11a7627b7e..50771a1f0f1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_grok_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_grok_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -19,10 +22,30 @@ import ( // UnifiedAgentMultilineGrokParser Multiline grok parser. type UnifiedAgentMultilineGrokParser struct { + // grok pattern object. + Patterns []GrokPattern `mandatory:"true" json:"patterns"` + // Specify time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,13 +63,14 @@ type UnifiedAgentMultilineGrokParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // grok name key. GrokNameKey *string `mandatory:"false" json:"grokNameKey"` + // grok failure key. GrokFailureKey *string `mandatory:"false" json:"grokFailureKey"` + // Multiline start regexp pattern. MultiLineStartRegexp *string `mandatory:"false" json:"multiLineStartRegexp"` - - Patterns []GrokPattern `mandatory:"false" json:"patterns"` } //GetFieldTimeKey returns FieldTimeKey diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_parser.go index db29be9fbd3..00e8b5e75b2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_multiline_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -19,10 +22,30 @@ import ( // UnifiedAgentMultilineParser Multiline parser. type UnifiedAgentMultilineParser struct { + // Mutiline pattern format. + Format []string `mandatory:"true" json:"format"` + // Specify time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,9 +63,8 @@ type UnifiedAgentMultilineParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // First line pattern format. FormatFirstline *string `mandatory:"false" json:"formatFirstline"` - - Format []string `mandatory:"false" json:"format"` } //GetFieldTimeKey returns FieldTimeKey diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_none_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_none_parser.go index f602eb29db5..f285dae6726 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_none_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_none_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentNoneParser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,6 +60,7 @@ type UnifiedAgentNoneParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // Specifies the field name to contain logs. MessageKey *string `mandatory:"false" json:"messageKey"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_parser.go index 0afdb906e98..659a6091d7d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentParser interface { GetFieldTimeKey() *string // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } GetTypes() map[string]string // Specify the null value pattern. @@ -125,6 +145,10 @@ func (m *unifiedagentparser) UnmarshalPolymorphicJSON(data []byte) (interface{}, mm := UnifiedAgentTsvParser{} err = json.Unmarshal(data, &mm) return mm, err + case "CRI": + mm := UnifiedAgentCriParser{} + err = json.Unmarshal(data, &mm) + return mm, err case "APACHE_ERROR": mm := UnifiedAgentApacheErrorParser{} err = json.Unmarshal(data, &mm) @@ -200,6 +224,7 @@ type UnifiedAgentParserParserTypeEnum string // Set of constants representing the allowable values for UnifiedAgentParserParserTypeEnum const ( UnifiedAgentParserParserTypeAuditd UnifiedAgentParserParserTypeEnum = "AUDITD" + UnifiedAgentParserParserTypeCri UnifiedAgentParserParserTypeEnum = "CRI" UnifiedAgentParserParserTypeJson UnifiedAgentParserParserTypeEnum = "JSON" UnifiedAgentParserParserTypeTsv UnifiedAgentParserParserTypeEnum = "TSV" UnifiedAgentParserParserTypeCsv UnifiedAgentParserParserTypeEnum = "CSV" @@ -216,6 +241,7 @@ const ( var mappingUnifiedAgentParserParserTypeEnum = map[string]UnifiedAgentParserParserTypeEnum{ "AUDITD": UnifiedAgentParserParserTypeAuditd, + "CRI": UnifiedAgentParserParserTypeCri, "JSON": UnifiedAgentParserParserTypeJson, "TSV": UnifiedAgentParserParserTypeTsv, "CSV": UnifiedAgentParserParserTypeCsv, @@ -232,6 +258,7 @@ var mappingUnifiedAgentParserParserTypeEnum = map[string]UnifiedAgentParserParse var mappingUnifiedAgentParserParserTypeEnumLowerCase = map[string]UnifiedAgentParserParserTypeEnum{ "auditd": UnifiedAgentParserParserTypeAuditd, + "cri": UnifiedAgentParserParserTypeCri, "json": UnifiedAgentParserParserTypeJson, "tsv": UnifiedAgentParserParserTypeTsv, "csv": UnifiedAgentParserParserTypeCsv, @@ -259,6 +286,7 @@ func GetUnifiedAgentParserParserTypeEnumValues() []UnifiedAgentParserParserTypeE func GetUnifiedAgentParserParserTypeEnumStringValues() []string { return []string{ "AUDITD", + "CRI", "JSON", "TSV", "CSV", diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_regex_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_regex_parser.go index 31506b2cf28..76f4bad6eab 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_regex_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_regex_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -19,10 +22,30 @@ import ( // UnifiedAgentRegexParser regexp parser. type UnifiedAgentRegexParser struct { + // Regex pattern. + Expression *string `mandatory:"true" json:"expression"` + // Specify time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,8 +63,7 @@ type UnifiedAgentRegexParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` - Expression *string `mandatory:"false" json:"expression"` - + // Time format. TimeFormat *string `mandatory:"false" json:"timeFormat"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_details.go index b3afb40e8cf..8d7f765f026 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_states.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_states.go index 8073da4da1a..297d8628129 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_states.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_states.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_types.go index db0cec1ea07..dbacf868f4f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_service_configuration_types.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_syslog_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_syslog_parser.go index b83acfb662a..5acb68305f0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_syslog_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_syslog_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedAgentSyslogParser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,16 +60,22 @@ type UnifiedAgentSyslogParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // Time format. TimeFormat *string `mandatory:"false" json:"timeFormat"` + // rfc5424 time format. Rfc5424TimeFormat *string `mandatory:"false" json:"rfc5424TimeFormat"` + // With priority or not. IsWithPriority *bool `mandatory:"false" json:"isWithPriority"` + // Support colonless ident or not. IsSupportColonlessIdent *bool `mandatory:"false" json:"isSupportColonlessIdent"` + // Message format of syslog. MessageFormat UnifiedAgentSyslogParserMessageFormatEnum `mandatory:"false" json:"messageFormat,omitempty"` + // Syslog parser type. SyslogParserType UnifiedAgentSyslogParserSyslogParserTypeEnum `mandatory:"false" json:"syslogParserType,omitempty"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tail_log_source.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tail_log_source.go index 8a38dfff7e3..ac3b7d1c2ff 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tail_log_source.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tail_log_source.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -22,7 +25,8 @@ type UnifiedAgentTailLogSource struct { // unique name for the source Name *string `mandatory:"true" json:"name"` - Paths []string `mandatory:"false" json:"paths"` + // Absolute paths for log source files. Wildcard can be used. + Paths []string `mandatory:"true" json:"paths"` Parser UnifiedAgentParser `mandatory:"false" json:"parser"` } @@ -65,9 +69,9 @@ func (m UnifiedAgentTailLogSource) MarshalJSON() (buff []byte, e error) { // UnmarshalJSON unmarshals from json func (m *UnifiedAgentTailLogSource) UnmarshalJSON(data []byte) (e error) { model := struct { - Paths []string `json:"paths"` Parser unifiedagentparser `json:"parser"` Name *string `json:"name"` + Paths []string `json:"paths"` }{} e = json.Unmarshal(data, &model) @@ -75,11 +79,6 @@ func (m *UnifiedAgentTailLogSource) UnmarshalJSON(data []byte) (e error) { return } var nn interface{} - m.Paths = make([]string, len(model.Paths)) - for i, n := range model.Paths { - m.Paths[i] = n - } - nn, e = model.Parser.UnmarshalPolymorphicJSON(model.Parser.JsonData) if e != nil { return @@ -92,5 +91,10 @@ func (m *UnifiedAgentTailLogSource) UnmarshalJSON(data []byte) (e error) { m.Name = model.Name + m.Paths = make([]string, len(model.Paths)) + for i, n := range model.Paths { + m.Paths[i] = n + } + return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tsv_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tsv_parser.go index 8359d65af54..df35ce452a7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tsv_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_tsv_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -19,10 +22,30 @@ import ( // UnifiedAgentTsvParser TSV Parser. type UnifiedAgentTsvParser struct { + // tsv keys. + Keys []string `mandatory:"true" json:"keys"` + // Specify time field for the event time. If the event doesn't have this field, the current time is used. FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,9 +63,8 @@ type UnifiedAgentTsvParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // tsv delimiter. Delimiter *string `mandatory:"false" json:"delimiter"` - - Keys []string `mandatory:"false" json:"keys"` } //GetFieldTimeKey returns FieldTimeKey diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_windows_event_source.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_windows_event_source.go index a9fa70c25da..54fdc016ec6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_windows_event_source.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_agent_windows_event_source.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -22,7 +25,8 @@ type UnifiedAgentWindowsEventSource struct { // unique name for the source Name *string `mandatory:"true" json:"name"` - Channels []string `mandatory:"false" json:"channels"` + // Windows event log channels. + Channels []string `mandatory:"true" json:"channels"` } //GetName returns Name diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_json_parser.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_json_parser.go index c5d964e7db3..8c48e695e1c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_json_parser.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/unified_json_parser.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -23,6 +26,23 @@ type UnifiedJsonParser struct { FieldTimeKey *string `mandatory:"false" json:"fieldTimeKey"` // Specify types for converting a field into another type. + // For example, + // With this configuration: + // + // @type csv + // keys time,host,req_id,user + // time_key time + // + // This incoming event: + // "2013/02/28 12:00:00,192.168.0.1,111,-" + // is parsed as: + // 1362020400 (2013/02/28/ 12:00:00) + // record: + // { + // "host" : "192.168.0.1", + // "req_id" : "111", + // "user" : "-" + // } Types map[string]string `mandatory:"false" json:"types"` // Specify the null value pattern. @@ -40,8 +60,10 @@ type UnifiedJsonParser struct { // Specify the timeout for parse processing. This is mainly for detecting an incorrect regexp pattern. TimeoutInMilliseconds *int `mandatory:"false" json:"timeoutInMilliseconds"` + // Process time value using the specified format. TimeFormat *string `mandatory:"false" json:"timeFormat"` + // Time type of JSON parser. TimeType UnifiedJsonParserTimeTypeEnum `mandatory:"false" json:"timeType,omitempty"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_configuration_details.go index a363e6171ae..a4ee0e999ff 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_configuration_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_details.go index 1e1da85a57e..c06e6f5a287 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -35,7 +38,7 @@ type UpdateLogDetails struct { // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` - // Log retention duration in 30-day increments (30, 60, 90 and so on). + // Log retention duration in 30-day increments (30, 60, 90 and so on until 180). RetentionDuration *int `mandatory:"false" json:"retentionDuration"` Configuration *UpdateConfigurationDetails `mandatory:"false" json:"configuration"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_group_details.go index 02df9f24b81..e7376a54fc4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_group_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_group_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_details.go index 3c546b77353..e9c54430d5a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -15,7 +18,7 @@ import ( "strings" ) -// UpdateLogSavedSearchDetails The update details to update a log saved search. +// UpdateLogSavedSearchDetails The update details to update a LogSavedSearch. type UpdateLogSavedSearchDetails struct { // The user-friendly display name. This must be unique within the enclosing resource, diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_request_response.go index f7f4d91440f..f8671bda0dd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_log_saved_search_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/logging/UpdateLogSavedSearch.go.html to see an example of how to use UpdateLogSavedSearchRequest. type UpdateLogSavedSearchRequest struct { - // OCID of the logSavedSearch + // OCID of the logSavedSearch. LogSavedSearchId *string `mandatory:"true" contributesTo:"path" name:"logSavedSearchId"` // Updates to the saved search. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_unified_agent_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_unified_agent_configuration_details.go index 69ca122463e..36f624d55f0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_unified_agent_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/update_unified_agent_configuration_details.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request.go index 16c8b49ce54..02e1bcc8b03 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -27,7 +30,7 @@ type WorkRequest struct { // The current status of the work request. Status OperationStatusEnum `mandatory:"true" json:"status"` - // The work request’s compartment OCID. + // The work request's compartment OCID. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The resources this work request affects. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_error.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_error.go index 02b6018d2f6..86f554dc96b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_error.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_error.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_log.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_log.go index d9f38d42fa2..b8844ffdb04 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_log.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_log.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_resource.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_resource.go index 8a3c84a54b2..b016c299cbc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_resource.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_resource.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_summary.go index ad863cfc45a..c14d2b67234 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/logging/work_request_summary.go @@ -4,7 +4,10 @@ // Logging Management API // -// Use the Logging Management API to create, read, list, update, and delete log groups, log objects, and agent configurations. +// Use the Logging Management API to create, read, list, update, move and delete +// log groups, log objects, log saved searches, agent configurations, log data models, +// continuous queries, and managed continuous queries. +// For more information, see Logging Overview (https://docs.cloud.oracle.com/iaas/Content/Logging/Concepts/loggingoverview.htm). // package logging @@ -27,7 +30,7 @@ type WorkRequestSummary struct { // The current status of the work request. Status OperationStatusEnum `mandatory:"false" json:"status,omitempty"` - // The OCID of the work request’s compartment. + // The OCID of the work request's compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` // The resources this work request affects. diff --git a/vendor/modules.txt b/vendor/modules.txt index 9889090b76b..8d535d541bc 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.38.0 +# github.com/oracle/oci-go-sdk/v65 v65.38.0 => ./vendor/github.com/oracle/oci-go-sdk ## explicit; go 1.13 github.com/oracle/oci-go-sdk/v65/adm github.com/oracle/oci-go-sdk/v65/aianomalydetection From 2a1b33714fc223d7f066dd528b258d06296f1be9 Mon Sep 17 00:00:00 2001 From: Sagar Pokale Date: Fri, 19 May 2023 16:40:00 -0500 Subject: [PATCH 12/16] Finalize changelog and release for version v4.122.0 --- CHANGELOG.md | 15 +++++++++++++++ internal/globalvar/version.go | 4 ++-- website/oci.erb | 9 +++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fabdc187cd2..dab33d73a09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 4.122.0 (Unreleased) + +### Added +- Remove hardcoded passwords from golden_gate integration test codes +- ExaDB-C@C (EXACC) Data Plane Guest VMs (API/UI Only) +- Support for Node Subsetting | ADB-D +- Support for DNS Secondary Egress and creating DNS zones from zone files +- Support for unified agent config CRI parser +- Support for Create oci_dns_rrsets data source +- Changes for setting resource ID in state file before workrequest completion +### Bug Fix +- Populate user resource optional fields only if they arent empty +: Remove system tags from SZ requests +- adding fix for cloudguard detector rule condition paramter unmarshalling issue + ## 4.121.0 (May 17, 2023) ### Added diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index a6c201f3a4d..bee0873e218 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "4.121.0" -const ReleaseDate = "2023-05-17" +const Version = "4.122.0" +const ReleaseDate = "2023-05-24" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) diff --git a/website/oci.erb b/website/oci.erb index 809ccf8d446..4a91c30d996 100644 --- a/website/oci.erb +++ b/website/oci.erb @@ -2734,6 +2734,9 @@
  • oci_database_exadata_infrastructure_download_config_file
  • +
  • + oci_database_exadata_infrastructure_un_allocated_resource +
  • oci_database_exadata_infrastructures
  • @@ -3658,6 +3661,9 @@
  • oci_dns_rrset
  • +
  • + oci_dns_rrsets +
  • oci_dns_steering_policies
  • @@ -3690,6 +3696,9 @@ > Resources