// 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.AdmService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Adm
{
public class UpdateRemediationRecipeExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateRemediationRecipeDetails = new Oci.AdmService.Models.UpdateRemediationRecipeDetails
{
DisplayName = "EXAMPLE-displayName-Value",
ScmConfiguration = new Oci.AdmService.Models.ExternalScmConfiguration
{
ExternalScmType = Oci.AdmService.Models.ExternalScmConfiguration.ExternalScmTypeEnum.Github,
RepositoryUrl = "EXAMPLE-repositoryUrl-Value",
Username = "EXAMPLE-username-Value",
PatSecretId = "ocid1.test.oc1..<unique_ID>EXAMPLE-patSecretId-Value",
Branch = "EXAMPLE-branch-Value",
BuildFileLocation = "EXAMPLE-buildFileLocation-Value",
IsAutomergeEnabled = false
},
VerifyConfiguration = new Oci.AdmService.Models.JenkinsPipelineConfiguration
{
Username = "EXAMPLE-username-Value",
PatSecretId = "ocid1.test.oc1..<unique_ID>EXAMPLE-patSecretId-Value",
JenkinsUrl = "EXAMPLE-jenkinsUrl-Value",
JobName = "EXAMPLE-jobName-Value",
AdditionalParameters = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_KBkek",
"EXAMPLE_VALUE_FqjaL0n3QjFIlMwKld2G"
}
}
},
DetectConfiguration = new Oci.AdmService.Models.DetectConfiguration
{
Exclusions = new List<string>
{
"EXAMPLE--Value"
},
UpgradePolicy = Oci.AdmService.Models.DetectConfiguration.UpgradePolicyEnum.Nearest,
MaxPermissibleCvssV2Score = (float)3.6075842,
MaxPermissibleCvssV3Score = (float)0.9014523,
MaxPermissibleSeverity = Oci.AdmService.Models.ConfigSeverity.High
},
NetworkConfiguration = new Oci.AdmService.Models.NetworkConfiguration
{
SubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
NsgIds = new List<string>
{
"EXAMPLE--Value"
}
},
KnowledgeBaseId = "ocid1.test.oc1..<unique_ID>EXAMPLE-knowledgeBaseId-Value",
IsRunTriggeredOnKbChange = true,
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_AKoSk",
"EXAMPLE_VALUE_wVqFutiL9aYqkQzfpQeW"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_V0nYz",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_kfiaT",
"EXAMPLE--Value"
}
}
}
}
};
var updateRemediationRecipeRequest = new Oci.AdmService.Requests.UpdateRemediationRecipeRequest
{
RemediationRecipeId = "ocid1.test.oc1..<unique_ID>EXAMPLE-remediationRecipeId-Value",
UpdateRemediationRecipeDetails = updateRemediationRecipeDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "TX1UTT6IK4CN2C6UVGTA<unique_ID>"
};
// 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 ApplicationDependencyManagementClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateRemediationRecipe(updateRemediationRecipeRequest);
// Retrieve value from the response.
var versionValue = response.httpResponseMessage.Version;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateRemediationRecipe Failed with {e.Message}");
throw e;
}
}
}
}