// 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.Truncate,
},
ReplicateSchemaChange = new Oci.GoldengateService.Models.ReplicateSchemaChange
{
CanReplicateSchemaChange = Oci.GoldengateService.Models.ReplicateSchemaChange.CanReplicateSchemaChangeEnum.Enabled,
ActionOnDdlError = Oci.GoldengateService.Models.ReplicateDdlErrorAction.Ignore,
ActionOnDmlError = Oci.GoldengateService.Models.ReplicateDmlErrorAction.Discard
},
ShouldRestartOnFailure = Oci.GoldengateService.Models.ProcessOptions.ShouldRestartOnFailureEnum.Enabled,
StartUsingDefaultMapping = Oci.GoldengateService.Models.ProcessOptions.StartUsingDefaultMappingEnum.Enabled
},
MappingRules = new List<Oci.GoldengateService.Models.MappingRule>
{
new Oci.GoldengateService.Models.MappingRule
{
MappingType = Oci.GoldengateService.Models.MappingType.Exclude,
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_mbul5",
"EXAMPLE_VALUE_DxgkhdnaftFeIbkgxjCd"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_UG8er",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_5x9wY",
"EXAMPLE--Value"
}
}
}
},
SubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
};
var updatePipelineRequest = new Oci.GoldengateService.Requests.UpdatePipelineRequest
{
PipelineId = "ocid1.test.oc1..<unique_ID>EXAMPLE-pipelineId-Value",
UpdatePipelineDetails = updatePipelineDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "LNABSS4IDYY2NUR3XHJ8<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;
}
}
}
}