// 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).
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.GoldengateService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Goldengate
{
public class UpdatePipelineExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updatePipelineDetails = new Oci.GoldengateService.Models.UpdateZeroEtlPipelineDetails
{
ProcessOptions = new Oci.GoldengateService.Models.ProcessOptions
{
InitialDataLoad = new Oci.GoldengateService.Models.InitialDataLoad
{
IsInitialLoad = Oci.GoldengateService.Models.InitialDataLoad.IsInitialLoadEnum.Disabled,
ActionOnExistingTable = Oci.GoldengateService.Models.InitialLoadAction.Skip,
InitialLoadType = Oci.GoldengateService.Models.InitialDataLoad.InitialLoadTypeEnum.ObjectStorage,
AdbWalletPath = "EXAMPLE-adbWalletPath-Value",
SourceWalletPath = "EXAMPLE-sourceWalletPath-Value",
TargetWalletPath = "EXAMPLE-targetWalletPath-Value",
NamespaceName = "EXAMPLE-namespaceName-Value",
BucketName = "EXAMPLE-bucketName-Value"
},
ReplicateSchemaChange = new Oci.GoldengateService.Models.ReplicateSchemaChange
{
CanReplicateSchemaChange = Oci.GoldengateService.Models.ReplicateSchemaChange.CanReplicateSchemaChangeEnum.Disabled,
ActionOnDdlError = Oci.GoldengateService.Models.ReplicateDdlErrorAction.Terminate,
ActionOnDmlError = Oci.GoldengateService.Models.ReplicateDmlErrorAction.Ignore
},
ShouldRestartOnFailure = Oci.GoldengateService.Models.ProcessOptions.ShouldRestartOnFailureEnum.Enabled,
StartUsingDefaultMapping = Oci.GoldengateService.Models.ProcessOptions.StartUsingDefaultMappingEnum.Disabled
},
MappingRules = new List<Oci.GoldengateService.Models.MappingRule>
{
new Oci.GoldengateService.Models.MappingRule
{
MappingType = Oci.GoldengateService.Models.MappingType.Include,
Source = "EXAMPLE-source-Value",
Target = "EXAMPLE-target-Value"
}
},
DisplayName = "EXAMPLE-displayName-Value",
Description = "EXAMPLE-description-Value",
LicenseModel = Oci.GoldengateService.Models.LicenseModel.BringYourOwnLicense,
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_1veWP",
"EXAMPLE_VALUE_jMylEmaykelg4DAa8rTW"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_rmk75",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_pu5rD",
"EXAMPLE--Value"
}
}
}
},
SubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
CpuCoreCount = 18,
IsAutoScalingEnabled = false
};
var updatePipelineRequest = new Oci.GoldengateService.Requests.UpdatePipelineRequest
{
PipelineId = "ocid1.test.oc1..<unique_ID>EXAMPLE-pipelineId-Value",
UpdatePipelineDetails = updatePipelineDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "XA4DMJVNJPCOWD2MB4ZX<unique_ID>",
IsLockOverride = true
};
// 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.
var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
try
{
// Create a service client and send the request.
using (var client = new GoldenGateClient(provider, new ClientConfiguration()))
{
var response = await client.UpdatePipeline(updatePipelineRequest);
// Retrieve value from the response.
var versionValue = response.httpResponseMessage.Version;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdatePipeline Failed with {e.Message}");
throw e;
}
}
}
}