# 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
opensearch_client = OCI::Opensearch::OpensearchClusterClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_opensearch_cluster_response =
opensearch_client.create_opensearch_cluster(
OCI::Opensearch::Models::CreateOpensearchClusterDetails.new(
display_name: 'EXAMPLE-displayName-Value',
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
software_version: 'EXAMPLE-softwareVersion-Value',
master_node_count: 836,
master_node_host_type: 'BM',
master_node_host_ocpu_count: 2128,
master_node_host_memory_gb: 94_663,
data_node_count: 647,
data_node_host_type: 'BM',
data_node_host_ocpu_count: 981,
data_node_host_memory_gb: 92_024,
data_node_storage_gb: 38_061,
opendashboard_node_count: 60,
opendashboard_node_host_ocpu_count: 1753,
opendashboard_node_host_memory_gb: 5988,
vcn_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-vcnId-Value',
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
vcn_compartment_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-vcnCompartmentId-Value',
subnet_compartment_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetCompartmentId-Value',
master_node_host_bare_metal_shape:
'EXAMPLE-masterNodeHostBareMetalShape-Value',
data_node_host_bare_metal_shape:
'EXAMPLE-dataNodeHostBareMetalShape-Value',
security_mode: 'ENFORCING',
security_master_user_name: 'EXAMPLE-securityMasterUserName-Value',
security_master_user_password_hash:
'EXAMPLE-securityMasterUserPasswordHash-Value',
freeform_tags: {
'EXAMPLE_KEY_WqD4H' => 'EXAMPLE_VALUE_dN1bzK2H9CGomCGmLqps'
},
defined_tags: {
'EXAMPLE_KEY_2ix96' => { 'EXAMPLE_KEY_xFHHk' => 'EXAMPLE--Value' }
},
system_tags: {
'EXAMPLE_KEY_Q7LUd' => { 'EXAMPLE_KEY_gMObz' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{create_opensearch_cluster_response.headers}"