// 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 ExampleUpdateAutonomousDatabase() {
// 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.UpdateAutonomousDatabaseRequest{AutonomousDatabaseId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDatabaseId-Value"),
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcDryRun: common.Bool(true),
OpcRequestId: common.String("WFVJXLWSCVBB8NQOSWZZ<unique_ID>"),
UpdateAutonomousDatabaseDetails: database.UpdateAutonomousDatabaseDetails{AdminPassword: common.String("EXAMPLE-adminPassword-Value"),
IsAutoScalingEnabled: common.Bool(false),
IsLocalDataGuardEnabled: common.Bool(true),
IsMtlsConnectionRequired: common.Bool(true),
OcpuCount: common.Float32(272.98035),
PrivateEndpointIp: common.String("EXAMPLE-privateEndpointIp-Value"),
SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
DatabaseEdition: database.AutonomousDatabaseSummaryDatabaseEditionEnterpriseEdition,
DbName: common.String("EXAMPLE-dbName-Value"),
IsDevTier: common.Bool(false),
TimeMaintenancePauseUntil: &common.SDKTime{Time: time.Now()},
TimeScheduledDbVersionUpgrade: &common.SDKTime{Time: time.Now()},
VanityUrlDetails: &database.VanityUrlDetails{IsDisabled: common.Bool(true),
VanityUrlHostName: common.String("EXAMPLE-vanityUrlHostName-Value"),
ApiGatewayId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-apiGatewayId-Value")},
AutoRefreshFrequencyInSeconds: common.Int(355251),
DisplayName: common.String("EXAMPLE-displayName-Value"),
IsAccessControlEnabled: common.Bool(true),
IsRefreshableClone: common.Bool(true),
LocalAdgAutoFailoverMaxDataLossLimit: common.Int(505),
IsFreeTier: common.Bool(false),
PeerDbId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-peerDbId-Value"),
ResourcePoolSummary: &database.ResourcePoolSummary{IsDisabled: common.Bool(false),
PoolSize: common.Int(920),
PoolStorageSizeInTBs: common.Int(696),
TotalComputeCapacity: common.Int(702),
AvailableComputeCapacity: common.Int(283),
AvailableStorageCapacityInTBs: common.Float64(1077.317)},
DataStorageSizeInGBs: common.Int(61657),
DataStorageSizeInTBs: common.Int(73),
RefreshableMode: database.UpdateAutonomousDatabaseDetailsRefreshableModeManual,
SecretVersionNumber: common.Int(5),
AutonomousDatabaseMaintenanceWindow: &database.AutonomousDatabaseMaintenanceWindowSummary{DayOfWeek: &database.DayOfWeek{Name: database.DayOfWeekNameTuesday},
MaintenanceEndTime: common.String("EXAMPLE-maintenanceEndTime-Value"),
MaintenanceStartTime: common.String("EXAMPLE-maintenanceStartTime-Value")},
ComputeCount: common.Float32(2404.532),
NsgIds: []string{"EXAMPLE--Value"},
TimeOfAutoRefreshStart: &common.SDKTime{Time: time.Now()},
ByolComputeCountLimit: common.Float32(1912.4633),
CustomerContacts: []database.CustomerContact{database.CustomerContact{Email: common.String("EXAMPLE-email-Value")}},
EncryptionKey: database.AwsKeyDetails{ArnRole: common.String("EXAMPLE-arnRole-Value"),
ExternalId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-externalId-Value"),
KeyArn: common.String("EXAMPLE-keyArn-Value"),
ServiceEndpointUri: common.String("EXAMPLE-serviceEndpointUri-Value")},
IsDisableDbVersionUpgradeSchedule: common.Bool(false),
OpenMode: database.UpdateAutonomousDatabaseDetailsOpenModeOnly,
PermissionLevel: database.UpdateAutonomousDatabaseDetailsPermissionLevelUnrestricted,
ResourcePoolLeaderId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-resourcePoolLeaderId-Value"),
ScheduledOperations: []database.ScheduledOperationDetails{database.ScheduledOperationDetails{DayOfWeek: &database.DayOfWeek{Name: database.DayOfWeekNameThursday},
ScheduledStartTime: common.String("EXAMPLE-scheduledStartTime-Value"),
ScheduledStopTime: common.String("EXAMPLE-scheduledStopTime-Value")}},
BackupRetentionPeriodInDays: common.Int(955),
ComputeModel: database.UpdateAutonomousDatabaseDetailsComputeModelEcpu,
IsDisconnectPeer: common.Bool(false),
WhitelistedIps: []string{"EXAMPLE--Value"},
AutonomousMaintenanceScheduleType: database.UpdateAutonomousDatabaseDetailsAutonomousMaintenanceScheduleTypeEarly,
DbWorkload: database.UpdateAutonomousDatabaseDetailsDbWorkloadOltp,
IsScheduleDbVersionUpgradeToEarliest: common.Bool(false),
SecurityAttributes: map[string]map[string]interface{}{"EXAMPLE_KEY_TNciH": map[string]interface{}{"EXAMPLE_KEY_vevNC": "EXAMPLE--Value"}},
ArePrimaryWhitelistedIpsUsed: common.Bool(false),
AutoRefreshPointLagInSeconds: common.Int(388846),
IsAutoScalingForStorageEnabled: common.Bool(false),
IsDataGuardEnabled: common.Bool(true),
PrivateEndpointLabel: common.String("EXAMPLE-privateEndpointLabel-Value"),
DbVersion: common.String("EXAMPLE-dbVersion-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_2rdPy": map[string]interface{}{"EXAMPLE_KEY_OIprN": "EXAMPLE--Value"}},
FreeformTags: map[string]string{"EXAMPLE_KEY_VdhkP": "EXAMPLE_VALUE_t9xDKXTxPbmyW8Akzj8h"},
InMemoryPercentage: common.Int(963),
LicenseModel: database.UpdateAutonomousDatabaseDetailsLicenseModelBringYourOwnLicense,
LongTermBackupSchedule: &database.LongTermBackUpScheduleDetails{IsDisabled: common.Bool(false),
RepeatCadence: database.LongTermBackUpScheduleDetailsRepeatCadenceMonthly,
RetentionPeriodInDays: common.Int(1055),
TimeOfBackup: &common.SDKTime{Time: time.Now()}},
CpuCoreCount: common.Int(124),
DbToolsDetails: []database.DatabaseTool{database.DatabaseTool{ComputeCount: common.Float32(7275.411),
IsEnabled: common.Bool(false),
MaxIdleTimeInMinutes: common.Int(118),
Name: database.DatabaseToolNameOml}},
IsBackupRetentionLocked: common.Bool(true),
LocalAdgResourcePoolLeaderId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-localAdgResourcePoolLeaderId-Value"),
StandbyWhitelistedIps: []string{"EXAMPLE--Value"},
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}}
// Send the request using the service client
resp, err := client.UpdateAutonomousDatabase(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}