// 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{NsgIds: []string{"EXAMPLE--Value"},
PrivateIp: common.String("EXAMPLE-privateIp-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
Domain: common.String("EXAMPLE-domain-Value"),
FaultDomains: []string{"EXAMPLE--Value"},
BackupNetworkNsgIds: []string{"EXAMPLE--Value"},
DataStoragePercentage: common.Int(864),
KmsKeyVersionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
StorageVolumePerformanceMode: database.LaunchDbSystemBaseStorageVolumePerformanceModeHighPerformance,
FreeformTags: map[string]string{"EXAMPLE_KEY_yyaU1": "EXAMPLE_VALUE_8PpVyFFLGKyElahHjUF6"},
InitialDataStorageSizeInGB: common.Int(126),
KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
SshPublicKeys: []string{"EXAMPLE--Value"},
DbSystemOptions: &database.DbSystemOptions{StorageManagement: database.DbSystemOptionsStorageManagementAsm},
Hostname: common.String("EXAMPLE-hostname-Value"),
NodeCount: common.Int(269),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_UjVGU": map[string]interface{}{"EXAMPLE_KEY_V8zBO": "EXAMPLE--Value"}},
DiskRedundancy: database.LaunchDbSystemFromDatabaseDetailsDiskRedundancyHigh,
LicenseModel: database.LaunchDbSystemFromDatabaseDetailsLicenseModelBringYourOwnLicense,
Shape: common.String("EXAMPLE-shape-Value"),
SparseDiskgroup: common.Bool(false),
ClusterName: common.String("EXAMPLE-clusterName-Value"),
DataCollectionOptions: &database.DataCollectionOptions{IsDiagnosticsEventsEnabled: common.Bool(false),
IsHealthMonitoringEnabled: common.Bool(true),
IsIncidentLogsEnabled: common.Bool(false)},
DatabaseEdition: database.LaunchDbSystemFromDatabaseDetailsDatabaseEditionEnterpriseEditionExtremePerformance,
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
CpuCoreCount: common.Int(23),
AvailabilityDomain: common.String("EXAMPLE-availabilityDomain-Value"),
BackupSubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
DbHome: &database.CreateDbHomeFromDatabaseDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_GabSU": map[string]interface{}{"EXAMPLE_KEY_KOpYH": "EXAMPLE--Value"}},
DisplayName: common.String("EXAMPLE-displayName-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_ieZVn": "EXAMPLE_VALUE_uKDSj0x3W8pyyHtXsXmZ"},
Database: &database.CreateDatabaseFromAnotherDatabaseDetails{AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
BackupTDEPassword: common.String("EXAMPLE-backupTDEPassword-Value"),
DatabaseId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value"),
DbName: common.String("EXAMPLE-dbName-Value"),
DbUniqueName: common.String("EXAMPLE-dbUniqueName-Value"),
PluggableDatabases: []string{"EXAMPLE--Value"},
TimeStampForPointInTimeRecovery: &common.SDKTime{Time: time.Now()}}},
TimeZone: common.String("EXAMPLE-timeZone-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)
}