// 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"

	"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.LaunchDbSystemFromDbSystemDetails{FaultDomains: []string{"EXAMPLE--Value"},
		FreeformTags:        map[string]string{"EXAMPLE_KEY_eq6LU": "EXAMPLE_VALUE_4QHsXDIeU48mLJBguUC4"},
		SshPublicKeys:       []string{"EXAMPLE--Value"},
		CpuCoreCount:        common.Int(901),
		DefinedTags:         map[string]map[string]interface{}{"EXAMPLE_KEY_jgQfr": map[string]interface{}{"EXAMPLE_KEY_ySK5P": "EXAMPLE--Value"}},
		BackupNetworkNsgIds: []string{"EXAMPLE--Value"},
		DbHome: &database.CreateDbHomeFromDbSystemDetails{Database: &database.CreateDatabaseFromDbSystemDetails{DbName: common.String("EXAMPLE-dbName-Value"),
			DbUniqueName:  common.String("EXAMPLE-dbUniqueName-Value"),
			DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_AZStk": map[string]interface{}{"EXAMPLE_KEY_Kxg07": "EXAMPLE--Value"}},
			FreeformTags:  map[string]string{"EXAMPLE_KEY_K3Nlm": "EXAMPLE_VALUE_Olqv1VJfvli5q3VwMche"},
			AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
			DbBackupConfig: &database.DbBackupConfig{AutoBackupWindow: database.DbBackupConfigAutoBackupWindowOne,
				AutoFullBackupDay:    database.DbBackupConfigAutoFullBackupDaySunday,
				AutoFullBackupWindow: database.DbBackupConfigAutoFullBackupWindowFive,
				BackupDeletionPolicy: database.DbBackupConfigBackupDeletionPolicyAfterRetentionPeriod,
				BackupDestinationDetails: []database.BackupDestinationDetails{database.BackupDestinationDetails{RemoteRegion: common.String("EXAMPLE-remoteRegion-Value"),
					Type:          database.BackupDestinationDetailsTypeNfs,
					VpcPassword:   common.String("EXAMPLE-vpcPassword-Value"),
					VpcUser:       common.String("EXAMPLE-vpcUser-Value"),
					DbrsPolicyId:  common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-dbrsPolicyId-Value"),
					Id:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
					InternetProxy: common.String("EXAMPLE-internetProxy-Value"),
					IsRemote:      common.Bool(false)}},
				RecoveryWindowInDays:   common.Int(18),
				RunImmediateFullBackup: common.Bool(false),
				AutoBackupEnabled:      common.Bool(true)},
			DbDomain: common.String("EXAMPLE-dbDomain-Value")},
			DefinedTags:  map[string]map[string]interface{}{"EXAMPLE_KEY_TUKYg": map[string]interface{}{"EXAMPLE_KEY_cWt0q": "EXAMPLE--Value"}},
			DisplayName:  common.String("EXAMPLE-displayName-Value"),
			FreeformTags: map[string]string{"EXAMPLE_KEY_qurdJ": "EXAMPLE_VALUE_K06BrI8yMjN7Hc2lVgm1"}},
		Hostname:                     common.String("EXAMPLE-hostname-Value"),
		KmsKeyVersionId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
		NsgIds:                       []string{"EXAMPLE--Value"},
		PrivateIpV6:                  common.String("EXAMPLE-privateIpV6-Value"),
		StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeHighPerformance,
		ClusterName:                  common.String("EXAMPLE-clusterName-Value"),
		DataCollectionOptions: &database.DataCollectionOptions{IsIncidentLogsEnabled: common.Bool(false),
			IsDiagnosticsEventsEnabled: common.Bool(false),
			IsHealthMonitoringEnabled:  common.Bool(true)},
		DbSystemOptions:            &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementAsm},
		InitialDataStorageSizeInGB: common.Int(281),
		SecurityAttributes:         map[string]map[string]interface{}{"EXAMPLE_KEY_vNFI4": map[string]interface{}{"EXAMPLE_KEY_xgLbQ": "EXAMPLE--Value"}},
		SourceDbSystemId:           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDbSystemId-Value"),
		SparseDiskgroup:            common.Bool(false),
		TimeZone:                   common.String("EXAMPLE-timeZone-Value"),
		BackupSubnetId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
		CompartmentId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		KmsKeyId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
		NodeCount:                  common.Int(802),
		PrivateIp:                  common.String("EXAMPLE-privateIp-Value"),
		DisplayName:                common.String("EXAMPLE-displayName-Value"),
		Domain:                     common.String("EXAMPLE-domain-Value"),
		AvailabilityDomain:         common.String("EXAMPLE-availabilityDomain-Value"),
		DataStoragePercentage:      common.Int(930),
		LicenseModel:               database.LaunchDbSystemFromDbSystemDetailsLicenseModelBringYourOwnLicense,
		Shape:                      common.String("EXAMPLE-shape-Value"),
		SubnetId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")},
		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)
}