# 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).

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
container_engine_client = oci.container_engine.ContainerEngineClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_node_pool_response = container_engine_client.update_node_pool(
    node_pool_id="ocid1.test.oc1..<unique_ID>EXAMPLE-nodePoolId-Value",
    update_node_pool_details=oci.container_engine.models.UpdateNodePoolDetails(
        name="EXAMPLE-name-Value",
        kubernetes_version="EXAMPLE-kubernetesVersion-Value",
        initial_node_labels=[
            oci.container_engine.models.KeyValue(
                key="EXAMPLE-key-Value",
                value="EXAMPLE-value-Value")],
        quantity_per_subnet=977,
        subnet_ids=["EXAMPLE--Value"],
        node_config_details=oci.container_engine.models.UpdateNodePoolNodeConfigDetails(
            size=362,
            nsg_ids=["EXAMPLE--Value"],
            kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
            is_pv_encryption_in_transit_enabled=False,
            freeform_tags={
                'EXAMPLE_KEY_kO17d': 'EXAMPLE_VALUE_RNBgXjG3CFEa9efPnxyM'},
            defined_tags={
                'EXAMPLE_KEY_2YYhm': {
                    'EXAMPLE_KEY_9IBO2': 'EXAMPLE--Value'}},
            placement_configs=[
                oci.container_engine.models.NodePoolPlacementConfigDetails(
                    availability_domain="EXAMPLE-availabilityDomain-Value",
                    subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
                    capacity_reservation_id="ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
                    preemptible_node_config=oci.container_engine.models.PreemptibleNodeConfigDetails(
                        preemption_action=oci.container_engine.models.TerminatePreemptionAction(
                            type="TERMINATE",
                            is_preserve_boot_volume=True)),
                    fault_domains=["EXAMPLE--Value"])],
            node_pool_pod_network_option_details=oci.container_engine.models.FlannelOverlayNodePoolPodNetworkOptionDetails(
                cni_type="FLANNEL_OVERLAY")),
        node_metadata={
            'EXAMPLE_KEY_3qAts': 'EXAMPLE_VALUE_zvUs6vpI1aex55ozo2Ax'},
        node_source_details=oci.container_engine.models.NodeSourceViaImageDetails(
            source_type="IMAGE",
            image_id="ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value",
            boot_volume_size_in_gbs=483),
        ssh_public_key="EXAMPLE-sshPublicKey-Value",
        node_shape="EXAMPLE-nodeShape-Value",
        node_shape_config=oci.container_engine.models.UpdateNodeShapeConfigDetails(
            ocpus=6308.8525,
            memory_in_gbs=9813.083),
        freeform_tags={
            'EXAMPLE_KEY_oJX1i': 'EXAMPLE_VALUE_PHmD4yfcBEsItWAHV7NL'},
        defined_tags={
            'EXAMPLE_KEY_GGJCc': {
                'EXAMPLE_KEY_j5Rdg': 'EXAMPLE--Value'}},
        node_eviction_node_pool_settings=oci.container_engine.models.NodeEvictionNodePoolSettings(
            eviction_grace_duration="EXAMPLE-evictionGraceDuration-Value",
            is_force_delete_after_grace_duration=False),
        node_pool_cycling_details=oci.container_engine.models.NodePoolCyclingDetails(
            maximum_unavailable="EXAMPLE-maximumUnavailable-Value",
            maximum_surge="EXAMPLE-maximumSurge-Value",
            is_node_cycling_enabled=True)),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="MSZTWIEUNMYXWBYG5PP2<unique_ID>",
    override_eviction_grace_duration="EXAMPLE-overrideEvictionGraceDuration-Value",
    is_force_deletion_after_override_grace_duration=True)

# Get the data from response
print(update_node_pool_response.headers)

Was this article helpful?