// 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 ExampleUpdateNodePool() {
	// 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.UpdateNodePoolRequest{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		IsForceDeletionAfterOverrideGraceDuration: common.Bool(true),
		NodePoolId:                    common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-nodePoolId-Value"),
		OpcRequestId:                  common.String("4NHBBXBLAOFASJXHJHVI<unique_ID>"),
		OverrideEvictionGraceDuration: common.String("EXAMPLE-overrideEvictionGraceDuration-Value"),
		UpdateNodePoolDetails: containerengine.UpdateNodePoolDetails{InitialNodeLabels: []containerengine.KeyValue{containerengine.KeyValue{Key: common.String("EXAMPLE-key-Value"),
			Value: common.String("EXAMPLE-value-Value")}},
			Name: common.String("EXAMPLE-name-Value"),
			NodePoolCyclingDetails: &containerengine.NodePoolCyclingDetails{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_c4u12": "EXAMPLE_VALUE_m4GSz6sppRVCghdsR0Su"},
			NodeConfigDetails: &containerengine.UpdateNodePoolNodeConfigDetails{IsPvEncryptionInTransitEnabled: common.Bool(false),
				KmsKeyId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value"),
				NodePoolPodNetworkOptionDetails: containerengine.OciVcnIpNativeNodePoolPodNetworkOptionDetails{MaxPodsPerNode: common.Int(55),
					PodNsgIds:    []string{"EXAMPLE--Value"},
					PodSubnetIds: []string{"EXAMPLE--Value"}},
				NsgIds: []string{"EXAMPLE--Value"},
				PlacementConfigs: []containerengine.NodePoolPlacementConfigDetails{containerengine.NodePoolPlacementConfigDetails{PreemptibleNodeConfig: &containerengine.PreemptibleNodeConfigDetails{PreemptionAction: containerengine.TerminatePreemptionAction{IsPreserveBootVolume: common.Bool(true)}},
					SubnetId:              common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
					AvailabilityDomain:    common.String("EXAMPLE-availabilityDomain-Value"),
					CapacityReservationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value"),
					FaultDomains:          []string{"EXAMPLE--Value"}}},
				Size:         common.Int(755),
				DefinedTags:  map[string]map[string]interface{}{"EXAMPLE_KEY_lnAB7": map[string]interface{}{"EXAMPLE_KEY_FltJh": "EXAMPLE--Value"}},
				FreeformTags: map[string]string{"EXAMPLE_KEY_pWiT0": "EXAMPLE_VALUE_lBYL5nd0eitqIhizvQn0"}},
			NodeEvictionNodePoolSettings: &containerengine.NodeEvictionNodePoolSettings{EvictionGraceDuration: common.String("EXAMPLE-evictionGraceDuration-Value"),
				IsForceDeleteAfterGraceDuration: common.Bool(true)},
			SshPublicKey:      common.String("EXAMPLE-sshPublicKey-Value"),
			KubernetesVersion: common.String("EXAMPLE-kubernetesVersion-Value"),
			NodeSourceDetails: containerengine.NodeSourceViaImageDetails{BootVolumeSizeInGBs: common.Int64(497),
				ImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value")},
			QuantityPerSubnet: common.Int(249),
			NodeShapeConfig: &containerengine.UpdateNodeShapeConfigDetails{MemoryInGBs: common.Float32(9506.1455),
				Ocpus: common.Float32(5420.0107)},
			NodeMetadata: map[string]string{"EXAMPLE_KEY_YbFTp": "EXAMPLE_VALUE_UFrU3BL99snWa434frqm"},
			NodeShape:    common.String("EXAMPLE-nodeShape-Value"),
			DefinedTags:  map[string]map[string]interface{}{"EXAMPLE_KEY_mAPUY": map[string]interface{}{"EXAMPLE_KEY_BpuS3": "EXAMPLE--Value"}}}}

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

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