// 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 = 6265,
StandbySize = 497,
DevicePolicy = new Oci.DesktopsService.Models.DesktopDevicePolicy
{
ClipboardMode = Oci.DesktopsService.Models.DesktopDevicePolicy.ClipboardModeEnum.None,
AudioMode = Oci.DesktopsService.Models.DesktopDevicePolicy.AudioModeEnum.None,
CdmMode = Oci.DesktopsService.Models.DesktopDevicePolicy.CdmModeEnum.None,
IsPrintingEnabled = true,
IsPointerEnabled = false,
IsKeyboardEnabled = true,
IsDisplayEnabled = false,
IsVideoInputEnabled = 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("12/28/2039 10:46:59"),
TimeStopScheduled = DateTime.Parse("09/08/2040 15:39:37"),
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_YXnLD",
"EXAMPLE_VALUE_96yk9qTxD8C9HyZhKRf2"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_G5anx",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_qgZSY",
"EXAMPLE--Value"
}
}
}
},
SessionLifecycleActions = new Oci.DesktopsService.Models.UpdateDesktopPoolDesktopSessionLifecycleActions
{
Inactivity = new Oci.DesktopsService.Models.InactivityConfig
{
Action = Oci.DesktopsService.Models.InactivityConfig.ActionEnum.None,
GracePeriodInMinutes = 1316
},
Disconnect = new Oci.DesktopsService.Models.DisconnectConfig
{
Action = Oci.DesktopsService.Models.DisconnectConfig.ActionEnum.Delete,
GracePeriodInMinutes = 376
}
},
Image = new Oci.DesktopsService.Models.UpdateDesktopImage
{
ImageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value"
},
NetworkConfiguration = new Oci.DesktopsService.Models.UpdateDesktopNetworkConfiguration
{
SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_X06tt",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_nLifk",
"EXAMPLE--Value"
}
}
}
}
},
PrivateAccessDetails = new Oci.DesktopsService.Models.UpdateDesktopPoolPrivateAccessDetails
{
SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_cmdnz",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_FzG2b",
"EXAMPLE--Value"
}
}
}
}
},
SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_gMmpT",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_fPWUb",
"EXAMPLE--Value"
}
}
}
},
BootVolumeSizeInGBs = 9981
};
var updateDesktopPoolRequest = new Oci.DesktopsService.Requests.UpdateDesktopPoolRequest
{
DesktopPoolId = "ocid1.test.oc1..<unique_ID>EXAMPLE-desktopPoolId-Value",
UpdateDesktopPoolDetails = updateDesktopPoolDetails,
OpcRequestId = "88SQK3ZAQMKY2WTI89PC<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;
}
}
}
}