# 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
dif_client = OCI::Dif::StackClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_stack_response =
dif_client.create_stack(
OCI::Dif::Models::CreateStackDetails.new(
display_name: 'EXAMPLE-displayName-Value',
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
stack_templates: %w[DEVOPSTOOLKIT],
services: %w[GGCS],
notification_email: 'EXAMPLE-notificationEmail-Value',
adb: [
OCI::Dif::Models::AdbDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
db_workload: 'OLTP',
ecpu: 683,
data_storage_size_in_tbs: 509,
admin_password_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-adminPasswordId-Value',
db_version: 'EXAMPLE-dbVersion-Value',
is_mtls_connection_required: true,
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
tools_public_access: 'EXAMPLE-toolsPublicAccess-Value',
is_public: false
)
],
ggcs: [
OCI::Dif::Models::GgcsDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
ocpu: 653,
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
password_secret_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value',
public_subnet_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-publicSubnetId-Value',
ogg_version: 'EXAMPLE-oggVersion-Value',
connections: [
OCI::Dif::Models::GgcsConnectionDetails.new(
connection_name: 'EXAMPLE-connectionName-Value',
dif_dependencies: [
OCI::Dif::Models::DifDependencyDetails.new(
service_type: 'EXAMPLE-serviceType-Value',
service_instance_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value'
)
],
gg_admin_secret_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-ggAdminSecretId-Value',
connection_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-connectionId-Value'
)
]
)
],
dataflow: [
OCI::Dif::Models::DataflowDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
spark_version: 'EXAMPLE-sparkVersion-Value',
driver_shape: 'EXAMPLE-driverShape-Value',
executor_shape: 'EXAMPLE-executorShape-Value',
num_executors: 631,
log_bucket_instance_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-logBucketInstanceId-Value',
driver_shape_config:
OCI::Dif::Models::ShapeConfig.new(memory_in_gbs: 499, ocpus: 26),
executor_shape_config:
OCI::Dif::Models::ShapeConfig.new(memory_in_gbs: 33, ocpus: 862),
private_endpoint_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value',
connections:
OCI::Dif::Models::DataflowConnections.new(
subnet_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value',
connection_details:
OCI::Dif::Models::DataflowConnectionDetails.new(
dif_dependencies: [
OCI::Dif::Models::DifDependencyDetails.new(
service_type: 'EXAMPLE-serviceType-Value',
service_instance_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-serviceInstanceId-Value'
)
],
domain_names: %w[EXAMPLE--Value]
)
),
warehouse_bucket_instance_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-warehouseBucketInstanceId-Value'
)
],
objectstorage: [
OCI::Dif::Models::ObjectStorageDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
object_versioning: 'DISABLED',
storage_tier: 'ARCHIVE',
auto_tiering: 'DISABLED'
)
],
genai: [
OCI::Dif::Models::GenAiDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
cluster_type: 'HOSTING',
base_model: 'EXAMPLE-baseModel-Value',
oci_region: 'EXAMPLE-ociRegion-Value',
unit_count: 35,
endpoints: [
OCI::Dif::Models::EndpointDetails.new(
endpoint_name: 'EXAMPLE-endpointName-Value',
is_content_moderation_enabled: true
)
]
)
],
aidataplatform: [
OCI::Dif::Models::AiDataPlatformDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
default_workspace_name: 'EXAMPLE-defaultWorkspaceName-Value'
)
],
omk: [
OCI::Dif::Models::OmkDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
cluster_namespace_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterNamespaceId-Value',
cluster_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value',
namespace_name: 'EXAMPLE-namespaceName-Value'
)
],
oke: [
OCI::Dif::Models::OkeDetail.new(
instance_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value',
cluster_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value',
namespace_name: 'EXAMPLE-namespaceName-Value'
)
],
freeform_tags: {
'EXAMPLE_KEY_kyWxz' => 'EXAMPLE_VALUE_N0JqCOEHEoBpzm9BkTpI'
},
defined_tags: {
'EXAMPLE_KEY_WsNzd' => { 'EXAMPLE_KEY_Sv8pw' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{create_stack_response.data}"