// 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/databasemigration"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleUpdateMigration() {
// 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 := databasemigration.NewDatabaseMigrationClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := databasemigration.UpdateMigrationRequest{UpdateMigrationDetails: databasemigration.UpdateMigrationDetails{TargetDatabaseConnectionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value"),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_MvE83": map[string]interface{}{"EXAMPLE_KEY_tF0Jk": "EXAMPLE--Value"}},
DisplayName: common.String("EXAMPLE-displayName-Value"),
GoldenGateDetails: &databasemigration.UpdateGoldenGateDetails{Hub: &databasemigration.UpdateGoldenGateHub{ComputeId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-computeId-Value"),
RestAdminCredentials: &databasemigration.UpdateAdminCredentials{Password: common.String("EXAMPLE-password-Value"),
Username: common.String("EXAMPLE-username-Value")},
SourceContainerDbAdminCredentials: &databasemigration.UpdateAdminCredentials{Password: common.String("EXAMPLE-password-Value"),
Username: common.String("EXAMPLE-username-Value")},
SourceDbAdminCredentials: &databasemigration.UpdateAdminCredentials{Username: common.String("EXAMPLE-username-Value"),
Password: common.String("EXAMPLE-password-Value")},
SourceMicroservicesDeploymentName: common.String("EXAMPLE-sourceMicroservicesDeploymentName-Value"),
TargetDbAdminCredentials: &databasemigration.UpdateAdminCredentials{Password: common.String("EXAMPLE-password-Value"),
Username: common.String("EXAMPLE-username-Value")},
TargetMicroservicesDeploymentName: common.String("EXAMPLE-targetMicroservicesDeploymentName-Value"),
Url: common.String("EXAMPLE-url-Value")},
Settings: &databasemigration.UpdateGoldenGateSettings{AcceptableLag: common.Int(13),
Extract: &databasemigration.UpdateExtract{LongTransDuration: common.Int(477),
PerformanceProfile: databasemigration.ExtractPerformanceProfileLow},
Replicat: &databasemigration.UpdateReplicat{MinApplyParallelism: common.Int(232),
PerformanceProfile: databasemigration.ReplicatPerformanceProfileLow,
MapParallelism: common.Int(43),
MaxApplyParallelism: common.Int(156)}}},
GoldenGateServiceDetails: &databasemigration.UpdateGoldenGateServiceDetails{Settings: &databasemigration.UpdateGoldenGateSettings{AcceptableLag: common.Int(5),
Extract: &databasemigration.UpdateExtract{LongTransDuration: common.Int(150),
PerformanceProfile: databasemigration.ExtractPerformanceProfileHigh},
Replicat: &databasemigration.UpdateReplicat{PerformanceProfile: databasemigration.ReplicatPerformanceProfileLow,
MapParallelism: common.Int(35),
MaxApplyParallelism: common.Int(979),
MinApplyParallelism: common.Int(320)}},
SourceContainerDbCredentials: &databasemigration.DatabaseCredentials{Password: common.String("EXAMPLE-password-Value"),
Username: common.String("EXAMPLE-username-Value")},
SourceDbCredentials: &databasemigration.DatabaseCredentials{Password: common.String("EXAMPLE-password-Value"),
Username: common.String("EXAMPLE-username-Value")},
TargetDbCredentials: &databasemigration.DatabaseCredentials{Password: common.String("EXAMPLE-password-Value"),
Username: common.String("EXAMPLE-username-Value")}},
VaultDetails: &databasemigration.UpdateVaultDetails{VaultId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value"),
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
KeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value")},
AdvisorSettings: &databasemigration.UpdateAdvisorSettings{IsIgnoreErrors: common.Bool(true),
IsSkipAdvisor: common.Bool(false)},
AgentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-agentId-Value"),
ExcludeObjects: []databasemigration.DatabaseObject{databasemigration.DatabaseObject{IsOmitExcludedTableFromReplication: common.Bool(false),
ObjectName: common.String("EXAMPLE-objectName-Value"),
Owner: common.String("EXAMPLE-owner-Value"),
Type: common.String("EXAMPLE-type-Value")}},
IncludeObjects: []databasemigration.DatabaseObject{databasemigration.DatabaseObject{IsOmitExcludedTableFromReplication: common.Bool(false),
ObjectName: common.String("EXAMPLE-objectName-Value"),
Owner: common.String("EXAMPLE-owner-Value"),
Type: common.String("EXAMPLE-type-Value")}},
SourceContainerDatabaseConnectionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceContainerDatabaseConnectionId-Value"),
Type: databasemigration.MigrationTypesOnline,
DataTransferMediumDetails: &databasemigration.UpdateDataTransferMediumDetails{AwsS3Details: &databasemigration.UpdateAwsS3Details{AccessKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-accessKeyId-Value"),
Name: common.String("EXAMPLE-name-Value"),
Region: common.String("EXAMPLE-region-Value"),
SecretAccessKey: common.String("EXAMPLE-secretAccessKey-Value")},
DatabaseLinkDetails: &databasemigration.UpdateDatabaseLinkDetails{Name: common.String("EXAMPLE-name-Value"),
WalletBucket: &databasemigration.UpdateObjectStoreBucket{BucketName: common.String("EXAMPLE-bucketName-Value"),
NamespaceName: common.String("EXAMPLE-namespaceName-Value")}},
ObjectStorageDetails: &databasemigration.UpdateObjectStoreBucket{BucketName: common.String("EXAMPLE-bucketName-Value"),
NamespaceName: common.String("EXAMPLE-namespaceName-Value")}},
DataTransferMediumDetailsV2: databasemigration.DbLinkDataTransferMediumDetails{Name: common.String("EXAMPLE-name-Value"),
ObjectStorageBucket: &databasemigration.ObjectStoreBucket{BucketName: common.String("EXAMPLE-bucketName-Value"),
NamespaceName: common.String("EXAMPLE-namespaceName-Value")}},
DatapumpSettings: &databasemigration.UpdateDataPumpSettings{DataPumpParameters: &databasemigration.UpdateDataPumpParameters{TableExistsAction: databasemigration.DataPumpTableExistsActionReplace,
Estimate: databasemigration.DataPumpEstimateStatistics,
ExcludeParameters: []databasemigration.DataPumpExcludeParametersEnum{databasemigration.DataPumpExcludeParametersIndex,
databasemigration.DataPumpExcludeParametersMaterializedView,
databasemigration.DataPumpExcludeParametersMaterializedViewLog},
ExportParallelismDegree: common.Int(9),
ImportParallelismDegree: common.Int(816),
IsCluster: common.Bool(false)},
ExportDirectoryObject: &databasemigration.UpdateDirectoryObject{Name: common.String("EXAMPLE-name-Value"),
Path: common.String("EXAMPLE-path-Value")},
ImportDirectoryObject: &databasemigration.UpdateDirectoryObject{Path: common.String("EXAMPLE-path-Value"),
Name: common.String("EXAMPLE-name-Value")},
JobMode: databasemigration.DataPumpJobModeSchema,
MetadataRemaps: []databasemigration.MetadataRemap{databasemigration.MetadataRemap{Type: databasemigration.MetadataRemapTypeTablespace,
NewValue: common.String("EXAMPLE-newValue-Value"),
OldValue: common.String("EXAMPLE-oldValue-Value")}},
TablespaceDetails: databasemigration.UpdateAdbServerlesTablespaceDetails{}},
DumpTransferDetails: &databasemigration.UpdateDumpTransferDetails{SharedStorageMountTargetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sharedStorageMountTargetId-Value"),
Source: databasemigration.UpdateCurlTransferDetails{WalletLocation: common.String("EXAMPLE-walletLocation-Value")},
Target: databasemigration.UpdateOciCliDumpTransferDetails{OciHome: common.String("EXAMPLE-ociHome-Value"),
WalletLocation: common.String("EXAMPLE-walletLocation-Value")}},
FreeformTags: map[string]string{"EXAMPLE_KEY_oOtcD": "EXAMPLE_VALUE_nhIbkynMF8ZQH9hU2UW9"},
SourceDatabaseConnectionId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value")},
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
MigrationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-migrationId-Value"),
OpcRequestId: common.String("67HNZHWVXSQZHNATMMZ1<unique_ID>")}
// Send the request using the service client
resp, err := client.UpdateMigration(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}