// 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{OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
		LaunchDbSystemDetails: database.LaunchDbSystemFromDatabaseDetails{KmsKeyVersionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
			SubnetId:           common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
			AvailabilityDomain: common.String("EXAMPLE-availabilityDomain-Value"),
			DefinedTags:        map[string]map[string]interface{}{"EXAMPLE_KEY_npFr6": map[string]interface{}{"EXAMPLE_KEY_xA0pY": "EXAMPLE--Value"}},
			LicenseModel:       database.LaunchDbSystemFromDatabaseDetailsLicenseModelLicenseIncluded,
			Shape:              common.String("EXAMPLE-shape-Value"),
			SubscriptionId:     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value"),
			ComputeCount:       common.Int(978),
			DbSystemOptions:    &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementLvm},
			DiskRedundancy:     database.LaunchDbSystemFromDatabaseDetailsDiskRedundancyHigh,
			Domain:             common.String("EXAMPLE-domain-Value"),
			DisplayName:        common.String("EXAMPLE-displayName-Value"),
			NsgIds:             []string{"EXAMPLE--Value"},
			SparseDiskgroup:    common.Bool(false),
			DbHome: &database.CreateDbHomeFromDatabaseDetails{IsUnifiedAuditingEnabled: common.Bool(false),
				Database: &database.CreateDatabaseFromAnotherDatabaseDetails{DbName: common.String("EXAMPLE-dbName-Value"),
					DbUniqueName:                 common.String("EXAMPLE-dbUniqueName-Value"),
					DefinedTags:                  map[string]map[string]interface{}{"EXAMPLE_KEY_vfGhG": map[string]interface{}{"EXAMPLE_KEY_zQrXW": "EXAMPLE--Value"}},
					FreeformTags:                 map[string]string{"EXAMPLE_KEY_ujGnO": "EXAMPLE_VALUE_Xsfu5ReLLJI8bFhNTsYD"},
					RecoveryApplianceVpcPassword: common.String("EXAMPLE-recoveryApplianceVpcPassword-Value"),
					SidPrefix:                    common.String("EXAMPLE-sidPrefix-Value"),
					AdminPassword:                common.String("EXAMPLE-adminPassword-Value"),
					DatabaseId:                   common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value"),
					ManagedSoftwareUpdateDetails: &database.ManagedSoftwareUpdateInputDetails{IsEnrolled: common.Bool(true),
						PreferenceDetails: &database.ManagedSoftwareUpdatePreferenceDetails{DaysOfWeek: []database.ManagedSoftwareUpdateDayOfWeek{database.ManagedSoftwareUpdateDayOfWeek{DayOfWeek: database.ManagedSoftwareUpdateDayOfWeekDayOfWeekSaturday}},
							HourOfDay:  common.Int(11),
							UpdateMode: database.ManagedSoftwareUpdatePreferenceDetailsUpdateModeNonrolling,
							VersionSchemeDetails: database.VersionSchemeFromVersionSeriesDetails{MajorVersion: common.String("EXAMPLE-majorVersion-Value"),
								VersionPreference: database.VersionSchemeFromVersionSeriesDetailsVersionPreferenceN2}}},
					SourceEncryptionKeyLocationDetails: database.AwsEncryptionKeyDetails{AwsEncryptionKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-awsEncryptionKeyId-Value")},
					StorageSizeDetails: &database.DatabaseStorageSizeDetails{DataStorageSizeInGBs: common.Int(372),
						RecoStorageSizeInGBs: common.Int(388)},
					VmClusterId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vmClusterId-Value"),
					BackupTDEPassword:               common.String("EXAMPLE-backupTDEPassword-Value"),
					TimeStampForPointInTimeRecovery: &common.SDKTime{Time: time.Now()},
					PluggableDatabases:              []string{"EXAMPLE--Value"}},
				DefinedTags:  map[string]map[string]interface{}{"EXAMPLE_KEY_oX0zE": map[string]interface{}{"EXAMPLE_KEY_3r0Nh": "EXAMPLE--Value"}},
				DisplayName:  common.String("EXAMPLE-displayName-Value"),
				FreeformTags: map[string]string{"EXAMPLE_KEY_77gUi": "EXAMPLE_VALUE_Bxv8pI3evxRHD0WYY4Ad"}},
			InitialDataStorageSizeInGB: common.Int(606),
			TimeZone:                   common.String("EXAMPLE-timeZone-Value"),
			PrivateIp:                  common.String("EXAMPLE-privateIp-Value"),
			BackupSubnetId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
			ComputeModel:               database.LaunchDbSystemBaseComputeModelOcpu,
			DataCollectionOptions: &database.DataCollectionOptions{IsDiagnosticsEventsEnabled: common.Bool(true),
				IsHealthMonitoringEnabled: common.Bool(false),
				IsIncidentLogsEnabled:     common.Bool(true)},
			DataStoragePercentage:        common.Int(814),
			DatabaseEdition:              database.LaunchDbSystemFromDatabaseDetailsDatabaseEditionStandardEdition,
			Hostname:                     common.String("EXAMPLE-hostname-Value"),
			KmsKeyId:                     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
			ClusterName:                  common.String("EXAMPLE-clusterName-Value"),
			CompartmentId:                common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
			SecurityAttributes:           map[string]map[string]interface{}{"EXAMPLE_KEY_z6rYN": map[string]interface{}{"EXAMPLE_KEY_rPlWN": "EXAMPLE--Value"}},
			SshPublicKeys:                []string{"EXAMPLE--Value"},
			BackupNetworkNsgIds:          []string{"EXAMPLE--Value"},
			FaultDomains:                 []string{"EXAMPLE--Value"},
			FreeformTags:                 map[string]string{"EXAMPLE_KEY_KBM80": "EXAMPLE_VALUE_jJbkyYDYJWk3SNUXJfKF"},
			NodeCount:                    common.Int(495),
			PrivateIpV6:                  common.String("EXAMPLE-privateIpV6-Value"),
			StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeBalanced,
			ClusterPlacementGroupId:      common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value"),
			CpuCoreCount:                 common.Int(856)},
		OpcDryRun: common.Bool(false)}

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