// 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.LaunchDbSystemFromBackupDetails{ClusterPlacementGroupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value"),
		CpuCoreCount: common.Int(440),
		DataCollectionOptions: &database.DataCollectionOptions{IsIncidentLogsEnabled: common.Bool(false),
			IsDiagnosticsEventsEnabled: common.Bool(true),
			IsHealthMonitoringEnabled:  common.Bool(false)},
		FreeformTags:               map[string]string{"EXAMPLE_KEY_QGk1s": "EXAMPLE_VALUE_zyvHH3MBPqA0DIBti8Jv"},
		KmsKeyId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
		NodeCount:                  common.Int(964),
		Shape:                      common.String("EXAMPLE-shape-Value"),
		SubscriptionId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value"),
		AvailabilityDomain:         common.String("EXAMPLE-availabilityDomain-Value"),
		ClusterName:                common.String("EXAMPLE-clusterName-Value"),
		SparseDiskgroup:            common.Bool(false),
		SubnetId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
		InitialDataStorageSizeInGB: common.Int(201),
		IsOlderVersionAcknowledged: common.Bool(true),
		DataStoragePercentage:      common.Int(186),
		DisplayName:                common.String("EXAMPLE-displayName-Value"),
		KmsKeyVersionId:            common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
		PrivateIpV6:                common.String("EXAMPLE-privateIpV6-Value"),
		SecurityAttributes:         map[string]map[string]interface{}{"EXAMPLE_KEY_SDIt3": map[string]interface{}{"EXAMPLE_KEY_QCyYA": "EXAMPLE--Value"}},
		BackupSubnetId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
		ComputeCount:               common.Int(22),
		ComputeModel:               database.LaunchDbSystemBaseComputeModelEcpu,
		DbHome: &database.CreateDbHomeFromBackupDetails{IsUnifiedAuditingEnabled: common.Bool(true),
			Database: &database.CreateDatabaseFromBackupDetails{ManagedSoftwareUpdateDetails: &database.ManagedSoftwareUpdateInputDetails{IsEnrolled: common.Bool(true),
				PreferenceDetails: &database.ManagedSoftwareUpdatePreferenceDetails{VersionSchemeDetails: database.VersionSchemeFromVersionSeriesDetails{IsOlderVersionAcknowledged: common.Bool(false),
					MajorVersion:      common.String("EXAMPLE-majorVersion-Value"),
					VersionPreference: database.VersionSchemeFromVersionSeriesDetailsVersionPreferenceN2},
					DaysOfWeek: []database.ManagedSoftwareUpdateDayOfWeek{database.ManagedSoftwareUpdateDayOfWeek{DayOfWeek: database.ManagedSoftwareUpdateDayOfWeekDayOfWeekWednesday}},
					HourOfDay:  common.Int(8),
					UpdateMode: database.ManagedSoftwareUpdatePreferenceDetailsUpdateModeRolling}},
				SidPrefix:   common.String("EXAMPLE-sidPrefix-Value"),
				VmClusterId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vmClusterId-Value"),
				StorageSizeDetails: &database.DatabaseStorageSizeDetails{DataStorageSizeInGBs: common.Int(790),
					RecoStorageSizeInGBs: common.Int(804)},
				BackupTDEPassword: common.String("EXAMPLE-backupTDEPassword-Value"),
				DataSafeRegistrationDetails: &database.DataSafeRegistrationRequestDetails{ConnectionIds: []string{"EXAMPLE--Value"},
					Action: database.DataSafeRegistrationRequestDetailsActionUnregister},
				DbName:                             common.String("EXAMPLE-dbName-Value"),
				DbUniqueName:                       common.String("EXAMPLE-dbUniqueName-Value"),
				RecoveryApplianceVpcPassword:       common.String("EXAMPLE-recoveryApplianceVpcPassword-Value"),
				SourceEncryptionKeyLocationDetails: database.AzureEncryptionKeyDetails{AzureEncryptionKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-azureEncryptionKeyId-Value")},
				AdminPassword:                      common.String("EXAMPLE-adminPassword-Value"),
				DefinedTags:                        map[string]map[string]interface{}{"EXAMPLE_KEY_m7dVv": map[string]interface{}{"EXAMPLE_KEY_cGHvs": "EXAMPLE--Value"}},
				FreeformTags:                       map[string]string{"EXAMPLE_KEY_paEvF": "EXAMPLE_VALUE_iYnzGRMUbVCxsE9D2oNf"},
				PluggableDatabases:                 []string{"EXAMPLE--Value"},
				BackupId:                           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupId-Value")},
			DatabaseSoftwareImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value"),
			DefinedTags:             map[string]map[string]interface{}{"EXAMPLE_KEY_56X95": map[string]interface{}{"EXAMPLE_KEY_ARhFN": "EXAMPLE--Value"}},
			DisplayName:             common.String("EXAMPLE-displayName-Value"),
			FreeformTags:            map[string]string{"EXAMPLE_KEY_GjUG3": "EXAMPLE_VALUE_OjE84BoLlwWuJRZiNLSR"}},
		Domain:                       common.String("EXAMPLE-domain-Value"),
		SshPublicKeys:                []string{"EXAMPLE--Value"},
		BackupNetworkNsgIds:          []string{"EXAMPLE--Value"},
		CompartmentId:                common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		DatabaseEdition:              database.LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEditionExtremePerformance,
		DbSystemOptions:              &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementLvm},
		DefinedTags:                  map[string]map[string]interface{}{"EXAMPLE_KEY_Vm5aE": map[string]interface{}{"EXAMPLE_KEY_eZiK1": "EXAMPLE--Value"}},
		DiskRedundancy:               database.LaunchDbSystemFromBackupDetailsDiskRedundancyNormal,
		FaultDomains:                 []string{"EXAMPLE--Value"},
		PrivateIp:                    common.String("EXAMPLE-privateIp-Value"),
		Hostname:                     common.String("EXAMPLE-hostname-Value"),
		LicenseModel:                 database.LaunchDbSystemFromBackupDetailsLicenseModelBringYourOwnLicense,
		NsgIds:                       []string{"EXAMPLE--Value"},
		StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeBalanced,
		TimeZone:                     common.String("EXAMPLE-timeZone-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)
}