# 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::ComputeManagementClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_cluster_network_response =
core_client.create_cluster_network(
OCI::Core::Models::CreateClusterNetworkDetails.new(
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
instance_pools: [
OCI::Core::Models::CreateClusterNetworkInstancePoolDetails.new(
instance_configuration_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceConfigurationId-Value',
size: 497,
defined_tags: {
'EXAMPLE_KEY_jzO6r' => { 'EXAMPLE_KEY_BSTu0' => 'EXAMPLE--Value' }
},
display_name: 'EXAMPLE-displayName-Value',
freeform_tags: {
'EXAMPLE_KEY_WgC5a' => 'EXAMPLE_VALUE_IpmdiHcGwzQK6p0XxrQ4'
}
)
],
placement_configuration:
OCI::Core::Models::ClusterNetworkPlacementConfigurationDetails.new(
availability_domain: 'EXAMPLE-availabilityDomain-Value',
placement_constraint: 'SINGLE_TIER',
primary_subnet_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-primarySubnetId-Value',
primary_vnic_subnets:
OCI::Core::Models::InstancePoolPlacementPrimarySubnet.new(
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
is_assign_ipv6_ip: false,
ipv6_address_ipv6_subnet_cidr_pair_details: [
OCI::Core::Models::InstancePoolPlacementIpv6AddressIpv6SubnetCidrDetails
.new(ipv6_subnet_cidr: 'EXAMPLE-ipv6SubnetCidr-Value')
]
),
secondary_vnic_subnets: [
OCI::Core::Models::InstancePoolPlacementSecondaryVnicSubnet.new(
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
display_name: 'EXAMPLE-displayName-Value',
is_assign_ipv6_ip: false,
ipv6_address_ipv6_subnet_cidr_pair_details: [
OCI::Core::Models::InstancePoolPlacementIpv6AddressIpv6SubnetCidrDetails
.new(ipv6_subnet_cidr: 'EXAMPLE-ipv6SubnetCidr-Value')
]
)
]
),
defined_tags: {
'EXAMPLE_KEY_dflCi' => { 'EXAMPLE_KEY_9R044' => 'EXAMPLE--Value' }
},
display_name: 'EXAMPLE-displayName-Value',
freeform_tags: {
'EXAMPLE_KEY_xr81I' => 'EXAMPLE_VALUE_XYxFbuNhUyALKKVjzjDG'
},
cluster_configuration:
OCI::Core::Models::ClusterConfigurationDetails.new(
hpc_island_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-hpcIslandId-Value',
network_block_ids: %w[EXAMPLE--Value]
)
)
)
# Get the data from response
puts "#{create_cluster_network_response.data}"