// 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 * as containerengine from "oci-containerengine";
import common = require("oci-common");
// 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.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new containerengine.ContainerEngineClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const updateNodePoolDetails = {
name: "EXAMPLE-name-Value",
kubernetesVersion: "EXAMPLE-kubernetesVersion-Value",
initialNodeLabels: [{
key: "EXAMPLE-key-Value",
value: "EXAMPLE-value-Value",
}
],
quantityPerSubnet: 936,
subnetIds: ["EXAMPLE--Value" ],
nodeConfigDetails: {
size: 393,
nsgIds: ["EXAMPLE--Value" ],
kmsKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
isPvEncryptionInTransitEnabled: true,
freeformTags: {
EXAMPLE_KEY_9UQKm :"EXAMPLE_VALUE_7gtygll9jnpWQDSQdaJ2"
},
definedTags: {
EXAMPLE_KEY_yxxkW :{
EXAMPLE_KEY_oMA8G :"EXAMPLE--Value"
}
},
placementConfigs: [{
availabilityDomain: "EXAMPLE-availabilityDomain-Value",
subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
capacityReservationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
preemptibleNodeConfig: {
preemptionAction: {
type: "TERMINATE", isPreserveBootVolume: true
}
,
}
,
faultDomains: ["EXAMPLE--Value" ],
}
],
nodePoolPodNetworkOptionDetails: {
cniType: "OCI_VCN_IP_NATIVE", maxPodsPerNode: 66,
podNsgIds: ["EXAMPLE--Value" ],
podSubnetIds: ["EXAMPLE--Value" ]
}
,
}
,
nodeMetadata: {
EXAMPLE_KEY_MCIfO :"EXAMPLE_VALUE_mfyBBqpg9gN5wHJlYVQR"
},
nodeSourceDetails: {
sourceType: "IMAGE", imageId: "ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value",
bootVolumeSizeInGBs: 455
}
,
sshPublicKey: "EXAMPLE-sshPublicKey-Value",
nodeShape: "EXAMPLE-nodeShape-Value",
nodeShapeConfig: {
ocpus: 8443.27,
memoryInGBs: 6898.831,
}
,
freeformTags: {
EXAMPLE_KEY_hKmkR :"EXAMPLE_VALUE_5TkwvC5cmWXdtli2Gvru"
},
definedTags: {
EXAMPLE_KEY_Wo0kn :{
EXAMPLE_KEY_7E8pX :"EXAMPLE--Value"
}
},
nodeEvictionNodePoolSettings: {
evictionGraceDuration: "EXAMPLE-evictionGraceDuration-Value",
isForceDeleteAfterGraceDuration: false,
}
,
nodePoolCyclingDetails: {
maximumUnavailable: "EXAMPLE-maximumUnavailable-Value",
maximumSurge: "EXAMPLE-maximumSurge-Value",
isNodeCyclingEnabled: false,
}
,
}
const updateNodePoolRequest: containerengine.requests.UpdateNodePoolRequest = {
nodePoolId: "ocid1.test.oc1..<unique_ID>EXAMPLE-nodePoolId-Value",
updateNodePoolDetails: updateNodePoolDetails,
ifMatch: "EXAMPLE-ifMatch-Value",
opcRequestId: "PLIFFLW8AXJMSFZ93PIG<unique_ID>",
overrideEvictionGraceDuration: "EXAMPLE-overrideEvictionGraceDuration-Value",
isForceDeletionAfterOverrideGraceDuration: false,
};
// Send request to the Client.
const updateNodePoolResponse = await client.updateNodePool(updateNodePoolRequest);
}
catch (error) {
console.log("updateNodePool Failed with error " + error);
}
})();