// 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 = 7596,
StandbySize = 169,
DevicePolicy = new Oci.DesktopsService.Models.DesktopDevicePolicy
{
ClipboardMode = Oci.DesktopsService.Models.DesktopDevicePolicy.ClipboardModeEnum.Full,
AudioMode = Oci.DesktopsService.Models.DesktopDevicePolicy.AudioModeEnum.Todesktop,
CdmMode = Oci.DesktopsService.Models.DesktopDevicePolicy.CdmModeEnum.Readonly,
IsPrintingEnabled = true,
IsPointerEnabled = false,
IsKeyboardEnabled = true,
IsDisplayEnabled = true,
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("01/22/2009 16:29:18"),
TimeStopScheduled = DateTime.Parse("01/19/2016 07:49:30"),
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_zX4bO",
"EXAMPLE_VALUE_63HO0VUbcsle7kI980OY"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_Xuvon",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_aGTrg",
"EXAMPLE--Value"
}
}
}
},
SessionLifecycleActions = new Oci.DesktopsService.Models.UpdateDesktopPoolDesktopSessionLifecycleActions
{
Inactivity = new Oci.DesktopsService.Models.InactivityConfig
{
Action = Oci.DesktopsService.Models.InactivityConfig.ActionEnum.None,
GracePeriodInMinutes = 16
},
Disconnect = new Oci.DesktopsService.Models.DisconnectConfig
{
Action = Oci.DesktopsService.Models.DisconnectConfig.ActionEnum.Stop,
GracePeriodInMinutes = 1142
}
},
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_64ylS",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_d66dB",
"EXAMPLE--Value"
}
}
}
}
},
PrivateAccessDetails = new Oci.DesktopsService.Models.UpdateDesktopPoolPrivateAccessDetails
{
SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_sp5Dl",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_gwX7B",
"EXAMPLE--Value"
}
}
}
}
},
SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_0YXnL",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_NXFPo",
"EXAMPLE--Value"
}
}
}
},
BootVolumeSizeInGBs = 27401
};
var updateDesktopPoolRequest = new Oci.DesktopsService.Requests.UpdateDesktopPoolRequest
{
DesktopPoolId = "ocid1.test.oc1..<unique_ID>EXAMPLE-desktopPoolId-Value",
UpdateDesktopPoolDetails = updateDesktopPoolDetails,
OpcRequestId = "96YK9QTXD8C9HYZHKRF2<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;
}
}
}
}