// 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{NodePoolId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-nodePoolId-Value"),
		OpcRequestId:                  common.String("JGA0YHNEAA5PPWJUIC1Q<unique_ID>"),
		OverrideEvictionGraceDuration: common.String("EXAMPLE-overrideEvictionGraceDuration-Value"),
		UpdateNodePoolDetails: containerengine.UpdateNodePoolDetails{NodePoolCyclingDetails: &containerengine.NodePoolCyclingDetails{MaximumSurge: common.String("EXAMPLE-maximumSurge-Value"),
			MaximumUnavailable: common.String("EXAMPLE-maximumUnavailable-Value"),
			CycleModes: []containerengine.CycleModeEnum{containerengine.CycleModeBootVolumeReplace,
				containerengine.CycleModeInstanceReplace},
			IsNodeCyclingEnabled: common.Bool(false)},
			NodeShape:   common.String("EXAMPLE-nodeShape-Value"),
			SubnetIds:   []string{"EXAMPLE--Value"},
			DefinedTags: map[string]map[string]interface{}{"EXAMPLE_KEY_41fPE": map[string]interface{}{"EXAMPLE_KEY_vNBYn": "EXAMPLE--Value"}},
			InitialNodeLabels: []containerengine.KeyValue{containerengine.KeyValue{Key: common.String("EXAMPLE-key-Value"),
				Value: common.String("EXAMPLE-value-Value")}},
			KubernetesVersion: common.String("EXAMPLE-kubernetesVersion-Value"),
			NodeEvictionNodePoolSettings: &containerengine.NodeEvictionNodePoolSettings{EvictionGraceDuration: common.String("EXAMPLE-evictionGraceDuration-Value"),
				IsForceActionAfterGraceDuration: common.Bool(false),
				IsForceDeleteAfterGraceDuration: common.Bool(true)},
			FreeformTags: map[string]string{"EXAMPLE_KEY_6Qvpn": "EXAMPLE_VALUE_T9IKmT9CdNg8eg98PBOa"},
			Name:         common.String("EXAMPLE-name-Value"),
			NodeConfigDetails: &containerengine.UpdateNodePoolNodeConfigDetails{NodePoolPodNetworkOptionDetails: containerengine.OciVcnIpNativeNodePoolPodNetworkOptionDetails{MaxPodsPerNode: common.Int(42),
				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(573),
				DefinedTags:                    map[string]map[string]interface{}{"EXAMPLE_KEY_AzhCg": map[string]interface{}{"EXAMPLE_KEY_HGsne": "EXAMPLE--Value"}},
				FreeformTags:                   map[string]string{"EXAMPLE_KEY_ETt4T": "EXAMPLE_VALUE_qYK3KRakLD0V6YZJrBbY"},
				IsPvEncryptionInTransitEnabled: common.Bool(false),
				KmsKeyId:                       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value")},
			NodeMetadata: map[string]string{"EXAMPLE_KEY_FRILu": "EXAMPLE_VALUE_3N2KaRnRR2ihkqDduRvs"},
			NodeSourceDetails: containerengine.NodeSourceViaImageDetails{BootVolumeSizeInGBs: common.Int64(524),
				ImageId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value")},
			NodeShapeConfig: &containerengine.UpdateNodeShapeConfigDetails{MemoryInGBs: common.Float32(244.59958),
				Ocpus: common.Float32(8250.485)},
			QuantityPerSubnet: common.Int(494),
			SshPublicKey:      common.String("EXAMPLE-sshPublicKey-Value")},
		IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		IsForceDeletionAfterOverrideGraceDuration: common.Bool(false)}

	// 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)
}