// 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).
package main
import (
"context"
"fmt"
"time"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/desktops"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleCreateDesktopPool() {
// 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.
client, err := desktops.NewDesktopServiceClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := desktops.CreateDesktopPoolRequest{OpcRequestId: common.String("B1P6YBOHPY8VNSQKLZHF<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
CreateDesktopPoolDetails: desktops.CreateDesktopPoolDetails{StandbySize: common.Int(336),
StorageSizeInGBs: common.Int(17755),
TimeStartScheduled: &common.SDKTime{Time: time.Now()},
CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
IsStorageEnabled: common.Bool(true),
NsgIds: []string{"EXAMPLE--Value"},
PrivateAccessDetails: &desktops.CreateDesktopPoolPrivateAccessDetails{SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
NsgIds: []string{"EXAMPLE--Value"},
PrivateIp: common.String("EXAMPLE-privateIp-Value")},
ShapeConfig: &desktops.CreateDesktopPoolShapeConfigDetails{BaselineOcpuUtilization: desktops.CreateDesktopPoolShapeConfigDetailsBaselineOcpuUtilization8,
MemoryInGBs: common.Int64(102),
Ocpus: common.Int64(58)},
SessionLifecycleActions: &desktops.CreateDesktopPoolDesktopSessionLifecycleActions{Inactivity: &desktops.InactivityConfig{Action: desktops.InactivityConfigActionNone,
GracePeriodInMinutes: common.Int(902)},
Disconnect: &desktops.DisconnectConfig{Action: desktops.DisconnectConfigActionNone,
GracePeriodInMinutes: common.Int(683)}},
UseDedicatedVmHost: desktops.CreateDesktopPoolDetailsUseDedicatedVmHostFalse,
AvailabilityDomain: common.String("EXAMPLE-availabilityDomain-Value"),
DisplayName: common.String("EXAMPLE-displayName-Value"),
Image: &desktops.DesktopImage{ImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value"),
ImageName: common.String("EXAMPLE-imageName-Value"),
OperatingSystem: common.String("EXAMPLE-operatingSystem-Value")},
MaximumSize: common.Int(3981),
NetworkConfiguration: &desktops.DesktopNetworkConfiguration{SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
VcnId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-vcnId-Value")},
ArePrivilegedUsers: common.Bool(false),
DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_KI9DH": map[string]interface{}{"EXAMPLE_KEY_aojCd": "EXAMPLE--Value"}},
DevicePolicy: &desktops.DesktopDevicePolicy{IsPrintingEnabled: common.Bool(true),
AudioMode: desktops.DesktopDevicePolicyAudioModeTodesktop,
CdmMode: desktops.DesktopDevicePolicyCdmModeNone,
ClipboardMode: desktops.DesktopDevicePolicyClipboardModeFull,
IsDisplayEnabled: common.Bool(true),
IsKeyboardEnabled: common.Bool(true),
IsPointerEnabled: common.Bool(false)},
TimeStopScheduled: &common.SDKTime{Time: time.Now()},
StorageBackupPolicyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-storageBackupPolicyId-Value"),
AvailabilityPolicy: &desktops.DesktopAvailabilityPolicy{StartSchedule: &desktops.DesktopSchedule{CronExpression: common.String("EXAMPLE-cronExpression-Value"),
Timezone: common.String("EXAMPLE-timezone-Value")}},
ContactDetails: common.String("EXAMPLE-contactDetails-Value"),
Description: common.String("EXAMPLE-description-Value"),
FreeformTags: map[string]string{"EXAMPLE_KEY_ixNhY": "EXAMPLE_VALUE_Snfii9BXl5ndWW3MKSYh"},
ShapeName: common.String("EXAMPLE-shapeName-Value")}}
// Send the request using the service client
resp, err := client.CreateDesktopPool(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}