// 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{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		LaunchDbSystemDetails: database.LaunchDbSystemFromDbSystemDetails{TimeZone: common.String("EXAMPLE-timeZone-Value"),
			BackupSubnetId:               common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
			FaultDomains:                 []string{"EXAMPLE--Value"},
			KmsKeyId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
			StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeBalanced,
			ComputeCount:                 common.Int(53),
			DbHome: &database.CreateDbHomeFromDbSystemDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_r3g8w": map[string]interface{}{"EXAMPLE_KEY_5yfAz": "EXAMPLE--Value"}},
				DisplayName:  common.String("EXAMPLE-displayName-Value"),
				FreeformTags: map[string]string{"EXAMPLE_KEY_rblzE": "EXAMPLE_VALUE_oAgr51cBlGB2FL9pdpuI"},
				Database: &database.CreateDatabaseFromDbSystemDetails{DbBackupConfig: &database.DbBackupConfig{AutoFullBackupDay: database.DbBackupConfigAutoFullBackupDayTuesday,
					AutoFullBackupWindow: database.DbBackupConfigAutoFullBackupWindowTwo,
					BackupDeletionPolicy: database.DbBackupConfigBackupDeletionPolicyImmediately,
					BackupDestinationDetails: []database.BackupDestinationDetails{database.BackupDestinationDetails{Id: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
						InternetProxy:                    common.String("EXAMPLE-internetProxy-Value"),
						IsZeroDataLossEnabled:            common.Bool(true),
						Type:                             database.BackupDestinationDetailsTypeRecoveryAppliance,
						VpcPassword:                      common.String("EXAMPLE-vpcPassword-Value"),
						BackupRetentionPolicyOnTerminate: database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateFor72Hours,
						IsRemote:                         common.Bool(false),
						IsRetentionLockEnabled:           common.Bool(true),
						RemoteRegion:                     common.String("EXAMPLE-remoteRegion-Value"),
						VpcUser:                          common.String("EXAMPLE-vpcUser-Value"),
						DbrsPolicyId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-dbrsPolicyId-Value")}},
					RecoveryWindowInDays:   common.Int(42),
					RunImmediateFullBackup: common.Bool(false),
					AutoBackupEnabled:      common.Bool(false),
					AutoBackupWindow:       database.DbBackupConfigAutoBackupWindowNine},
					DbDomain:      common.String("EXAMPLE-dbDomain-Value"),
					DbName:        common.String("EXAMPLE-dbName-Value"),
					DbUniqueName:  common.String("EXAMPLE-dbUniqueName-Value"),
					DefinedTags:   map[string]map[string]interface{}{"EXAMPLE_KEY_ZcCtQ": map[string]interface{}{"EXAMPLE_KEY_oHKgM": "EXAMPLE--Value"}},
					FreeformTags:  map[string]string{"EXAMPLE_KEY_qflOT": "EXAMPLE_VALUE_8RxOaTQ17NIXDvL4xiE1"},
					AdminPassword: common.String("EXAMPLE-adminPassword-Value")}},
			Shape:               common.String("EXAMPLE-shape-Value"),
			PrivateIp:           common.String("EXAMPLE-privateIp-Value"),
			PrivateIpV6:         common.String("EXAMPLE-privateIpV6-Value"),
			BackupNetworkNsgIds: []string{"EXAMPLE--Value"},
			DataCollectionOptions: &database.DataCollectionOptions{IsHealthMonitoringEnabled: common.Bool(true),
				IsIncidentLogsEnabled:      common.Bool(false),
				IsDiagnosticsEventsEnabled: common.Bool(true)},
			Domain:                     common.String("EXAMPLE-domain-Value"),
			InitialDataStorageSizeInGB: common.Int(424),
			SourceDbSystemId:           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDbSystemId-Value"),
			SshPublicKeys:              []string{"EXAMPLE--Value"},
			ClusterName:                common.String("EXAMPLE-clusterName-Value"),
			ComputeModel:               database.LaunchDbSystemBaseComputeModelEcpu,
			DbSystemOptions:            &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementAsm},
			KmsKeyVersionId:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
			NsgIds:                     []string{"EXAMPLE--Value"},
			SparseDiskgroup:            common.Bool(true),
			SubscriptionId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value"),
			DataStoragePercentage:      common.Int(582),
			DefinedTags:                map[string]map[string]interface{}{"EXAMPLE_KEY_GZzuM": map[string]interface{}{"EXAMPLE_KEY_aOZk2": "EXAMPLE--Value"}},
			ClusterPlacementGroupId:    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value"),
			CpuCoreCount:               common.Int(742),
			FreeformTags:               map[string]string{"EXAMPLE_KEY_BLAxg": "EXAMPLE_VALUE_Dl4a7OIAocb8gvSBBUTT"},
			SecurityAttributes:         map[string]map[string]interface{}{"EXAMPLE_KEY_JdShL": map[string]interface{}{"EXAMPLE_KEY_tFxcP": "EXAMPLE--Value"}},
			NodeCount:                  common.Int(776),
			AvailabilityDomain:         common.String("EXAMPLE-availabilityDomain-Value"),
			CompartmentId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			DisplayName:                common.String("EXAMPLE-displayName-Value"),
			Hostname:                   common.String("EXAMPLE-hostname-Value"),
			LicenseModel:               database.LaunchDbSystemFromDbSystemDetailsLicenseModelBringYourOwnLicense,
			SubnetId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")},
		OpcDryRun: common.Bool(true)}

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