# 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
core_client = OCI::Core::VirtualNetworkClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_virtual_circuit_response =
  core_client.create_virtual_circuit(
    OCI::Core::Models::CreateVirtualCircuitDetails.new(
      compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
      type: 'PUBLIC',
      bandwidth_shape_name: 'EXAMPLE-bandwidthShapeName-Value',
      cross_connect_mappings: [
        OCI::Core::Models::CrossConnectMapping.new(
          bgp_md5_auth_key: 'EXAMPLE-bgpMd5AuthKey-Value',
          cross_connect_or_cross_connect_group_id:
            'ocid1.test.oc1..<unique_ID>EXAMPLE-crossConnectOrCrossConnectGroupId-Value',
          customer_bgp_peering_ip: 'EXAMPLE-customerBgpPeeringIp-Value',
          oracle_bgp_peering_ip: 'EXAMPLE-oracleBgpPeeringIp-Value',
          customer_bgp_peering_ipv6: 'EXAMPLE-customerBgpPeeringIpv6-Value',
          oracle_bgp_peering_ipv6: 'EXAMPLE-oracleBgpPeeringIpv6-Value',
          vlan: 4_613_574
        )
      ],
      routing_policy: %w[MARKET_LEVEL],
      bgp_admin_state: 'ENABLED',
      is_bfd_enabled: true,
      is_transport_mode: true,
      customer_bgp_asn: 591,
      customer_asn: 405,
      defined_tags: {
        'EXAMPLE_KEY_HmCvd' => { 'EXAMPLE_KEY_teGpL' => 'EXAMPLE--Value' }
      },
      display_name: 'EXAMPLE-displayName-Value',
      freeform_tags: {
        'EXAMPLE_KEY_gDlV2' => 'EXAMPLE_VALUE_ProgUkS2mqKIQbHMo6cD'
      },
      gateway_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-gatewayId-Value',
      provider_name: 'EXAMPLE-providerName-Value',
      provider_service_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-providerServiceId-Value',
      provider_service_key_name: 'EXAMPLE-providerServiceKeyName-Value',
      provider_service_name: 'EXAMPLE-providerServiceName-Value',
      public_prefixes: [
        OCI::Core::Models::CreateVirtualCircuitPublicPrefixDetails.new(
          cidr_block: 'EXAMPLE-cidrBlock-Value'
        )
      ],
      region: 'EXAMPLE-region-Value',
      ip_mtu: 'MTU_1500'
    )
  )

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