# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

require 'oci'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
database_client = OCI::Database::DatabaseClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_cloud_autonomous_vm_cluster_response =
  database_client.create_cloud_autonomous_vm_cluster(
    OCI::Database::Models::CreateCloudAutonomousVmClusterDetails.new(
      compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
      subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
      display_name: 'EXAMPLE-displayName-Value',
      cloud_exadata_infrastructure_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-cloudExadataInfrastructureId-Value',
      description: 'EXAMPLE-description-Value',
      total_container_databases: 591,
      cpu_core_count_per_node: 364,
      memory_per_oracle_compute_unit_in_gbs: 396,
      autonomous_data_storage_size_in_tbs: 1308.9138,
      cluster_time_zone: 'EXAMPLE-clusterTimeZone-Value',
      compute_model: 'ECPU',
      is_mtls_enabled_vm_cluster: true,
      db_servers: %w[EXAMPLE--Value],
      maintenance_window_details:
        OCI::Database::Models::MaintenanceWindow.new(
          preference: 'NO_PREFERENCE',
          patching_mode: 'NONROLLING',
          is_custom_action_timeout_enabled: true,
          custom_action_timeout_in_mins: 65,
          is_monthly_patching_enabled: false,
          months: [OCI::Database::Models::Month.new(name: 'JUNE')],
          weeks_of_month: [2],
          days_of_week: [
            OCI::Database::Models::DayOfWeek.new(name: 'THURSDAY')
          ],
          hours_of_day: [3],
          lead_time_in_weeks: 2,
          skip_ru: [True, False]
        ),
      scan_listener_port_tls: 7589,
      scan_listener_port_non_tls: 7919,
      license_model: 'BRING_YOUR_OWN_LICENSE',
      nsg_ids: %w[EXAMPLE--Value],
      freeform_tags: {
        'EXAMPLE_KEY_SAWO5' => 'EXAMPLE_VALUE_gPvARCpiqcNLvJRzNjh0'
      },
      defined_tags: {
        'EXAMPLE_KEY_BjU0R' => { 'EXAMPLE_KEY_4MpJL' => 'EXAMPLE--Value' }
      }
    )
  )

# Get the data from response
puts "#{create_cloud_autonomous_vm_cluster_response.data}"