// 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).

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/database"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleLaunchDbSystem() {
	// Create a default authentication provider that uses the DEFAULT
	// profile in the configuration file.
	// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
	client, err := database.NewDatabaseClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := database.LaunchDbSystemRequest{LaunchDbSystemDetails: database.LaunchDbSystemFromDatabaseDetails{PrivateIp: common.String("EXAMPLE-privateIp-Value"),
		BackupSubnetId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
		CompartmentId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DisplayName:                common.String("EXAMPLE-displayName-Value"),
		FaultDomains:               []string{"EXAMPLE--Value"},
		InitialDataStorageSizeInGB: common.Int(499),
		DatabaseEdition:            database.LaunchDbSystemFromDatabaseDetailsDatabaseEditionEnterpriseEditionHighPerformance,
		PrivateIpV6:                common.String("EXAMPLE-privateIpV6-Value"),
		SshPublicKeys:              []string{"EXAMPLE--Value"},
		DbHome: &database.CreateDbHomeFromDatabaseDetails{Database: &database.CreateDatabaseFromAnotherDatabaseDetails{AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
			BackupTDEPassword:               common.String("EXAMPLE-backupTDEPassword-Value"),
			DatabaseId:                      common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value"),
			DbName:                          common.String("EXAMPLE-dbName-Value"),
			DbUniqueName:                    common.String("EXAMPLE-dbUniqueName-Value"),
			PluggableDatabases:              []string{"EXAMPLE--Value"},
			TimeStampForPointInTimeRecovery: &common.SDKTime{Time: time.Now()}},
			DefinedTags:              map[string]map[string]interface{}{"EXAMPLE_KEY_Llt2v": map[string]interface{}{"EXAMPLE_KEY_PalCZ": "EXAMPLE--Value"}},
			DisplayName:              common.String("EXAMPLE-displayName-Value"),
			FreeformTags:             map[string]string{"EXAMPLE_KEY_vkVJm": "EXAMPLE_VALUE_ZDkWgu2XPM3PjsZoahfL"},
			IsUnifiedAuditingEnabled: common.Bool(false)},
		DiskRedundancy:               database.LaunchDbSystemFromDatabaseDetailsDiskRedundancyNormal,
		Hostname:                     common.String("EXAMPLE-hostname-Value"),
		KmsKeyId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
		LicenseModel:                 database.LaunchDbSystemFromDatabaseDetailsLicenseModelBringYourOwnLicense,
		Shape:                        common.String("EXAMPLE-shape-Value"),
		SparseDiskgroup:              common.Bool(true),
		AvailabilityDomain:           common.String("EXAMPLE-availabilityDomain-Value"),
		BackupNetworkNsgIds:          []string{"EXAMPLE--Value"},
		NsgIds:                       []string{"EXAMPLE--Value"},
		StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeBalanced,
		SubnetId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
		SubscriptionId:               common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value"),
		CpuCoreCount:                 common.Int(989),
		DataStoragePercentage:        common.Int(889),
		DbSystemOptions:              &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementLvm},
		ClusterName:                  common.String("EXAMPLE-clusterName-Value"),
		ComputeCount:                 common.Int(365),
		DataCollectionOptions: &database.DataCollectionOptions{IsDiagnosticsEventsEnabled: common.Bool(true),
			IsHealthMonitoringEnabled: common.Bool(false),
			IsIncidentLogsEnabled:     common.Bool(true)},
		DefinedTags:             map[string]map[string]interface{}{"EXAMPLE_KEY_sfBXV": map[string]interface{}{"EXAMPLE_KEY_rCiY6": "EXAMPLE--Value"}},
		Domain:                  common.String("EXAMPLE-domain-Value"),
		TimeZone:                common.String("EXAMPLE-timeZone-Value"),
		ClusterPlacementGroupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value"),
		FreeformTags:            map[string]string{"EXAMPLE_KEY_Noent": "EXAMPLE_VALUE_0Izr3SzI658V28nhYfcF"},
		KmsKeyVersionId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
		NodeCount:               common.Int(162),
		ComputeModel:            database.LaunchDbSystemBaseComputeModelEcpu,
		SecurityAttributes:      map[string]map[string]interface{}{"EXAMPLE_KEY_xiWOU": map[string]interface{}{"EXAMPLE_KEY_326g8": "EXAMPLE--Value"}}},
		OpcDryRun:     common.Bool(false),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

	// Send the request using the service client
	resp, err := client.LaunchDbSystem(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}