// 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{OpcDryRun: common.Bool(true),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
LaunchDbSystemDetails: database.LaunchDbSystemFromBackupDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_YsHXt": map[string]interface{}{"EXAMPLE_KEY_7xFrT": "EXAMPLE--Value"}},
Domain: common.String("EXAMPLE-domain-Value"),
FaultDomains: []string{"EXAMPLE--Value"},
PrivateIp: common.String("EXAMPLE-privateIp-Value"),
ClusterName: common.String("EXAMPLE-clusterName-Value"),
ComputeModel: database.LaunchDbSystemBaseComputeModelEcpu,
LicenseModel: database.LaunchDbSystemFromBackupDetailsLicenseModelBringYourOwnLicense,
NodeCount: common.Int(145),
NsgIds: []string{"EXAMPLE--Value"},
SecurityAttributes: map[string]map[string]interface{}{"EXAMPLE_KEY_BgT68": map[string]interface{}{"EXAMPLE_KEY_tN3FO": "EXAMPLE--Value"}},
StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeHighPerformance,
AvailabilityDomain: common.String("EXAMPLE-availabilityDomain-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
TimeZone: common.String("EXAMPLE-timeZone-Value"),
ClusterPlacementGroupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterPlacementGroupId-Value"),
ComputeCount: common.Int(666),
DatabaseEdition: database.LaunchDbSystemFromBackupDetailsDatabaseEditionEnterpriseEditionExtremePerformance,
DiskRedundancy: database.LaunchDbSystemFromBackupDetailsDiskRedundancyNormal,
KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
BackupNetworkNsgIds: []string{"EXAMPLE--Value"},
BackupSubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
DbHome: &database.CreateDbHomeFromBackupDetails{FreeformTags: map[string]string{"EXAMPLE_KEY_8dsR0": "EXAMPLE_VALUE_jRDoBuFzuefwJ3wKubRf"},
IsUnifiedAuditingEnabled: common.Bool(false),
Database: &database.CreateDatabaseFromBackupDetails{PluggableDatabases: []string{"EXAMPLE--Value"},
DbName: common.String("EXAMPLE-dbName-Value"),
DbUniqueName: common.String("EXAMPLE-dbUniqueName-Value"),
SidPrefix: common.String("EXAMPLE-sidPrefix-Value"),
SourceEncryptionKeyLocationDetails: database.AzureEncryptionKeyDetails{AzureEncryptionKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-azureEncryptionKeyId-Value")},
StorageSizeDetails: &database.DatabaseStorageSizeDetails{DataStorageSizeInGBs: common.Int(983),
RecoStorageSizeInGBs: common.Int(789)},
AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
BackupId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupId-Value"),
BackupTDEPassword: common.String("EXAMPLE-backupTDEPassword-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_3mJra": map[string]interface{}{"EXAMPLE_KEY_jFmXp": "EXAMPLE--Value"}},
FreeformTags: map[string]string{"EXAMPLE_KEY_UIa9C": "EXAMPLE_VALUE_U7WHdl1FrKvdh84JfT3b"}},
DatabaseSoftwareImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_zgoKZ": map[string]interface{}{"EXAMPLE_KEY_iOulD": "EXAMPLE--Value"}},
DisplayName: common.String("EXAMPLE-displayName-Value")},
FreeformTags: map[string]string{"EXAMPLE_KEY_9qvoh": "EXAMPLE_VALUE_T1VWhx8k2n0FQFNbHWnV"},
SparseDiskgroup: common.Bool(false),
DbSystemOptions: &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementAsm},
DisplayName: common.String("EXAMPLE-displayName-Value"),
KmsKeyVersionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
PrivateIpV6: common.String("EXAMPLE-privateIpV6-Value"),
SshPublicKeys: []string{"EXAMPLE--Value"},
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
SubscriptionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value"),
DataCollectionOptions: &database.DataCollectionOptions{IsDiagnosticsEventsEnabled: common.Bool(false),
IsHealthMonitoringEnabled: common.Bool(false),
IsIncidentLogsEnabled: common.Bool(false)},
DataStoragePercentage: common.Int(172),
Hostname: common.String("EXAMPLE-hostname-Value"),
InitialDataStorageSizeInGB: common.Int(725),
CpuCoreCount: common.Int(211),
Shape: common.String("EXAMPLE-shape-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)
}