# 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
datacc_client = OCI::Datacc::BaseinfraClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_infrastructure_response =
  datacc_client.create_infrastructure(
    OCI::Datacc::Models::CreateInfrastructureDetails.new(
      compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
      display_name: 'EXAMPLE-displayName-Value',
      system_model: 'X10_HA_512',
      shape: 'TWELVE_SSDS',
      cloud_control_plane_server1: 'EXAMPLE-cloudControlPlaneServer1-Value',
      cloud_control_plane_server2: 'EXAMPLE-cloudControlPlaneServer2-Value',
      netmask: 'EXAMPLE-netmask-Value',
      gateway: 'EXAMPLE-gateway-Value',
      dns_servers: %w[EXAMPLE--Value],
      ntp_servers: %w[EXAMPLE--Value],
      description: 'EXAMPLE-description-Value',
      admin_networkcidr: 'EXAMPLE-adminNetworkcidr-Value',
      data_disk_percentage: 37,
      contacts: [
        OCI::Datacc::Models::InfrastructureContact.new(
          name: 'EXAMPLE-name-Value',
          email: 'EXAMPLE-email-Value',
          is_primary: false,
          phone_number: 'EXAMPLE-phoneNumber-Value',
          is_contact_mos_validated: true
        )
      ],
      client_network_bonding_mode: 'LACP',
      backup_network_bonding_mode: 'LACP',
      cps_network_bonding_mode: 'LACP',
      client_network_bonding_interface: 'BTBOND1',
      backup_network_bonding_interface: 'BTBOND6',
      cps_network_bonding_interface: 'BTBOND2',
      acfs_file_system_storage_in_gbs: 2911.327,
      corporate_proxy: 'EXAMPLE-corporateProxy-Value',
      vlan_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value',
      maintenance_window:
        OCI::Datacc::Models::MaintenanceWindow.new(
          preference: 'NO_PREFERENCE',
          patching_mode: 'ROLLING',
          is_custom_action_timeout_enabled: true,
          custom_action_timeout_in_mins: 651,
          is_monthly_patching_enabled: false,
          months: %w[OCTOBER],
          weeks_of_month: [2],
          days_of_week: %w[WEDNESDAY],
          hours_of_day: [10],
          lead_time_in_weeks: 3
        ),
      freeform_tags: {
        'EXAMPLE_KEY_MnWMb' => 'EXAMPLE_VALUE_4UB3nE6jctj4CLs9pHjk'
      },
      defined_tags: {
        'EXAMPLE_KEY_B1qKJ' => { 'EXAMPLE_KEY_JCBjo' => 'EXAMPLE--Value' }
      }
    )
  )

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