// 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.FleetappsmanagementService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Fleetappsmanagement
{
public class UpdateSchedulerDefinitionExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateSchedulerDefinitionDetails = new Oci.FleetappsmanagementService.Models.UpdateSchedulerDefinitionDetails
{
DisplayName = "EXAMPLE-displayName-Value",
Description = "EXAMPLE-description-Value",
Schedule = new Oci.FleetappsmanagementService.Models.CustomSchedule
{
Recurrences = "EXAMPLE-recurrences-Value",
Duration = "EXAMPLE-duration-Value",
ExecutionStartdate = DateTime.Parse("02/16/2005 06:32:16")
},
ActionGroups = new List<Oci.FleetappsmanagementService.Models.ActionGroup>
{
new Oci.FleetappsmanagementService.Models.FleetBasedActionGroup
{
FleetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-fleetId-Value",
Sequence = 949,
RunbookId = "ocid1.test.oc1..<unique_ID>EXAMPLE-runbookId-Value",
RunbookVersionName = "EXAMPLE-runbookVersionName-Value",
DisplayName = "EXAMPLE-displayName-Value"
}
},
RunBooks = new List<Oci.FleetappsmanagementService.Models.OperationRunbook>
{
new Oci.FleetappsmanagementService.Models.OperationRunbook
{
RunbookId = "ocid1.test.oc1..<unique_ID>EXAMPLE-runbookId-Value",
RunbookVersionName = "EXAMPLE-runbookVersionName-Value",
InputParameters = new List<Oci.FleetappsmanagementService.Models.InputParameter>
{
new Oci.FleetappsmanagementService.Models.InputParameter
{
StepName = "EXAMPLE-stepName-Value",
Arguments = new List<Oci.FleetappsmanagementService.Models.TaskArgument>
{
new Oci.FleetappsmanagementService.Models.FileTaskArgument
{
Content = new Oci.FleetappsmanagementService.Models.InputFileObjectStorageBucketContentDetails
{
NamespaceName = "EXAMPLE-namespaceName-Value",
BucketName = "EXAMPLE-bucketName-Value",
ObjectName = "EXAMPLE-objectName-Value",
Checksum = "EXAMPLE-checksum-Value"
},
Name = "EXAMPLE-name-Value"
}
}
}
}
}
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_6MnPk",
"EXAMPLE_VALUE_lxDMIKgLfgCJJvklGnn2"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_9X6g3",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_5nuAt",
"EXAMPLE--Value"
}
}
}
}
};
var updateSchedulerDefinitionRequest = new Oci.FleetappsmanagementService.Requests.UpdateSchedulerDefinitionRequest
{
SchedulerDefinitionId = "ocid1.test.oc1..<unique_ID>EXAMPLE-schedulerDefinitionId-Value",
UpdateSchedulerDefinitionDetails = updateSchedulerDefinitionDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "VCLVRO6UHENHIPXACDIA<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 FleetAppsManagementOperationsClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateSchedulerDefinition(updateSchedulerDefinitionRequest);
// Retrieve value from the response.
var versionValue = response.httpResponseMessage.Version;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateSchedulerDefinition Failed with {e.Message}");
throw e;
}
}
}
}