// 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.DesktopsService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Desktops
{
public class UpdateDesktopPoolExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateDesktopPoolDetails = new Oci.DesktopsService.Models.UpdateDesktopPoolDetails
{
DisplayName = "EXAMPLE-displayName-Value",
Description = "EXAMPLE-description-Value",
MaximumSize = 9403,
StandbySize = 30,
DevicePolicy = new Oci.DesktopsService.Models.DesktopDevicePolicy
{
ClipboardMode = Oci.DesktopsService.Models.DesktopDevicePolicy.ClipboardModeEnum.Fromdesktop,
AudioMode = Oci.DesktopsService.Models.DesktopDevicePolicy.AudioModeEnum.None,
CdmMode = Oci.DesktopsService.Models.DesktopDevicePolicy.CdmModeEnum.Full,
IsPrintingEnabled = true,
IsPointerEnabled = true,
IsKeyboardEnabled = false,
IsDisplayEnabled = true
},
AvailabilityPolicy = new Oci.DesktopsService.Models.DesktopAvailabilityPolicy
{
StartSchedule = new Oci.DesktopsService.Models.DesktopSchedule
{
CronExpression = "EXAMPLE-cronExpression-Value",
Timezone = "EXAMPLE-timezone-Value"
},
},
ContactDetails = "EXAMPLE-contactDetails-Value",
TimeStartScheduled = DateTime.Parse("10/15/2041 14:28:00"),
TimeStopScheduled = DateTime.Parse("11/29/2016 08:40:16"),
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_4g5Tj",
"EXAMPLE_VALUE_ofCvy237oZgb8i9GqDOg"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_bsite",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_vaXaH",
"EXAMPLE--Value"
}
}
}
},
SessionLifecycleActions = new Oci.DesktopsService.Models.UpdateDesktopPoolDesktopSessionLifecycleActions
{
Inactivity = new Oci.DesktopsService.Models.InactivityConfig
{
Action = Oci.DesktopsService.Models.InactivityConfig.ActionEnum.Disconnect,
GracePeriodInMinutes = 967
},
Disconnect = new Oci.DesktopsService.Models.DisconnectConfig
{
Action = Oci.DesktopsService.Models.DisconnectConfig.ActionEnum.Stop,
GracePeriodInMinutes = 1185
}
}
};
var updateDesktopPoolRequest = new Oci.DesktopsService.Requests.UpdateDesktopPoolRequest
{
DesktopPoolId = "ocid1.test.oc1..<unique_ID>EXAMPLE-desktopPoolId-Value",
UpdateDesktopPoolDetails = updateDesktopPoolDetails,
OpcRequestId = "51RYH64Q2MA4AVWIFPVM<unique_ID>",
IfMatch = "EXAMPLE-ifMatch-Value"
};
// 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 DesktopServiceClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateDesktopPool(updateDesktopPoolRequest);
// Retrieve value from the response.
var versionValue = response.httpResponseMessage.Version;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateDesktopPool Failed with {e.Message}");
throw e;
}
}
}
}