// 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"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/containerengine"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleCreateNodePool() {
	// 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 := containerengine.NewContainerEngineClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := containerengine.CreateNodePoolRequest{CreateNodePoolDetails: containerengine.CreateNodePoolDetails{NodeImageName: common.String("EXAMPLE-nodeImageName-Value"),
		NodeShape: common.String("EXAMPLE-nodeShape-Value"),
		NodeShapeConfig: &containerengine.CreateNodeShapeConfigDetails{Ocpus: common.Float32(4086.3025),
			MemoryInGBs: common.Float32(1501.5364)},
		ClusterId:         common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value"),
		DefinedTags:       map[string]map[string]interface{}{"EXAMPLE_KEY_pF490": map[string]interface{}{"EXAMPLE_KEY_klC0H": "EXAMPLE--Value"}},
		QuantityPerSubnet: common.Int(884),
		NodeEvictionNodePoolSettings: &containerengine.NodeEvictionNodePoolSettings{IsForceActionAfterGraceDuration: common.Bool(true),
			IsForceDeleteAfterGraceDuration: common.Bool(false),
			EvictionGraceDuration:           common.String("EXAMPLE-evictionGraceDuration-Value")},
		NodeMetadata: map[string]string{"EXAMPLE_KEY_3de0K": "EXAMPLE_VALUE_JvbdM2q3W4kVxffV7SOu"},
		NodeSourceDetails: containerengine.NodeSourceViaImageDetails{BootVolumeSizeInGBs: common.Int64(932),
			ImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value")},
		SshPublicKey:  common.String("EXAMPLE-sshPublicKey-Value"),
		CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
		InitialNodeLabels: []containerengine.KeyValue{containerengine.KeyValue{Key: common.String("EXAMPLE-key-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
		Name: common.String("EXAMPLE-name-Value"),
		NodeConfigDetails: &containerengine.CreateNodePoolNodeConfigDetails{DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_ixWNX": map[string]interface{}{"EXAMPLE_KEY_7hvm5": "EXAMPLE--Value"}},
			FreeformTags:                   map[string]string{"EXAMPLE_KEY_5hlnw": "EXAMPLE_VALUE_htxRApajfypPMO39C9kS"},
			IsPvEncryptionInTransitEnabled: common.Bool(false),
			KmsKeyId:                       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
			NodePoolPodNetworkOptionDetails: containerengine.OciVcnIpNativeNodePoolPodNetworkOptionDetails{MaxPodsPerNode: common.Int(107),
				PodNsgIds:    []string{"EXAMPLE--Value"},
				PodSubnetIds: []string{"EXAMPLE--Value"}},
			NsgIds: []string{"EXAMPLE--Value"},
			PlacementConfigs: []containerengine.NodePoolPlacementConfigDetails{containerengine.NodePoolPlacementConfigDetails{AvailabilityDomain: common.String("EXAMPLE-availabilityDomain-Value"),
				CapacityReservationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value"),
				FaultDomains:          []string{"EXAMPLE--Value"},
				PreemptibleNodeConfig: &containerengine.PreemptibleNodeConfigDetails{PreemptionAction: containerengine.TerminatePreemptionAction{IsPreserveBootVolume: common.Bool(false)}},
				SubnetId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value")}},
			Size: common.Int(995)},
		NodePoolCyclingDetails: &containerengine.NodePoolCyclingDetails{CycleModes: []containerengine.CycleModeEnum{containerengine.CycleModeBootVolumeReplace,
			containerengine.CycleModeInstanceReplace},
			IsNodeCyclingEnabled: common.Bool(false),
			MaximumSurge:         common.String("EXAMPLE-maximumSurge-Value"),
			MaximumUnavailable:   common.String("EXAMPLE-maximumUnavailable-Value")},
		SubnetIds:         []string{"EXAMPLE--Value"},
		FreeformTags:      map[string]string{"EXAMPLE_KEY_JJjFz": "EXAMPLE_VALUE_f8l2pskbBusrtQOKwiHV"},
		KubernetesVersion: common.String("EXAMPLE-kubernetesVersion-Value")},
		OpcRequestId:  common.String("7UJW1JUBNV7UGKCN1M6E<unique_ID>"),
		OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}

	// Send the request using the service client
	resp, err := client.CreateNodePool(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}