// 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{DataCollectionOptions: &database.DataCollectionOptions{IsDiagnosticsEventsEnabled: common.Bool(true),
IsHealthMonitoringEnabled: common.Bool(false),
IsIncidentLogsEnabled: common.Bool(true)},
FreeformTags: map[string]string{"EXAMPLE_KEY_h9zmU": "EXAMPLE_VALUE_wyTVVHFFr4tmQFktf1Pw"},
BackupNetworkNsgIds: []string{"EXAMPLE--Value"},
DbSystemOptions: &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementAsm},
InitialDataStorageSizeInGB: common.Int(890),
NodeCount: common.Int(474),
PrivateIp: common.String("EXAMPLE-privateIp-Value"),
PrivateIpV6: common.String("EXAMPLE-privateIpV6-Value"),
Shape: common.String("EXAMPLE-shape-Value"),
SourceDbSystemId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDbSystemId-Value"),
SshPublicKeys: []string{"EXAMPLE--Value"},
AvailabilityDomain: common.String("EXAMPLE-availabilityDomain-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
ClusterName: common.String("EXAMPLE-clusterName-Value"),
Hostname: common.String("EXAMPLE-hostname-Value"),
SparseDiskgroup: common.Bool(true),
Domain: common.String("EXAMPLE-domain-Value"),
BackupSubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
KmsKeyVersionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
LicenseModel: database.LaunchDbSystemFromDbSystemDetailsLicenseModelBringYourOwnLicense,
StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeBalanced,
DbHome: &database.CreateDbHomeFromDbSystemDetails{FreeformTags: map[string]string{"EXAMPLE_KEY_8UExk": "EXAMPLE_VALUE_lKjscT3YL0YIBtI4y12H"},
Database: &database.CreateDatabaseFromDbSystemDetails{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_PCOK0": map[string]interface{}{"EXAMPLE_KEY_f2ylG": "EXAMPLE--Value"}},
FreeformTags: map[string]string{"EXAMPLE_KEY_spvqF": "EXAMPLE_VALUE_4pb4B0EQj0w6huFwqSKb"},
AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
DbBackupConfig: &database.DbBackupConfig{BackupDeletionPolicy: database.DbBackupConfigBackupDeletionPolicyAfterRetentionPeriod,
BackupDestinationDetails: []database.BackupDestinationDetails{database.BackupDestinationDetails{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),
RemoteRegion: common.String("EXAMPLE-remoteRegion-Value"),
Type: database.BackupDestinationDetailsTypeLocal,
VpcPassword: common.String("EXAMPLE-vpcPassword-Value"),
VpcUser: common.String("EXAMPLE-vpcUser-Value")}},
RecoveryWindowInDays: common.Int(16),
RunImmediateFullBackup: common.Bool(true),
AutoBackupEnabled: common.Bool(false),
AutoBackupWindow: database.DbBackupConfigAutoBackupWindowTwelve,
AutoFullBackupDay: database.DbBackupConfigAutoFullBackupDayThursday,
AutoFullBackupWindow: database.DbBackupConfigAutoFullBackupWindowFive}},
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_0qqgn": map[string]interface{}{"EXAMPLE_KEY_g0TOG": "EXAMPLE--Value"}},
DisplayName: common.String("EXAMPLE-displayName-Value")},
FaultDomains: []string{"EXAMPLE--Value"},
KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
CpuCoreCount: common.Int(581),
DataStoragePercentage: common.Int(395),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_ninoh": map[string]interface{}{"EXAMPLE_KEY_ltmS5": "EXAMPLE--Value"}},
NsgIds: []string{"EXAMPLE--Value"},
SecurityAttributes: map[string]map[string]interface{}{"EXAMPLE_KEY_QOJnb": map[string]interface{}{"EXAMPLE_KEY_aAA2p": "EXAMPLE--Value"}},
TimeZone: common.String("EXAMPLE-timeZone-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)
}