# 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
create_node_pool_response = container_engine_client.create_node_pool(
create_node_pool_details=oci.container_engine.models.CreateNodePoolDetails(
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value",
name="EXAMPLE-name-Value",
node_shape="EXAMPLE-nodeShape-Value",
kubernetes_version="EXAMPLE-kubernetesVersion-Value",
node_metadata={
'EXAMPLE_KEY_0NCoL': 'EXAMPLE_VALUE_IaqfM2mThV4NELk5tRDl'},
node_image_name="EXAMPLE-nodeImageName-Value",
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=326),
node_shape_config=oci.container_engine.models.CreateNodeShapeConfigDetails(
ocpus=9465.472,
memory_in_gbs=7129.0576),
initial_node_labels=[
oci.container_engine.models.KeyValue(
key="EXAMPLE-key-Value",
value="EXAMPLE-value-Value")],
ssh_public_key="EXAMPLE-sshPublicKey-Value",
quantity_per_subnet=746,
subnet_ids=["EXAMPLE--Value"],
node_config_details=oci.container_engine.models.CreateNodePoolNodeConfigDetails(
size=477,
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",
fault_domains=["EXAMPLE--Value"])],
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_43NLl': 'EXAMPLE_VALUE_Mqqo65i1RE7hDkqMSCTn'},
defined_tags={
'EXAMPLE_KEY_QF3as': {
'EXAMPLE_KEY_Gxh5A': 'EXAMPLE--Value'}}),
freeform_tags={
'EXAMPLE_KEY_MFBQ4': 'EXAMPLE_VALUE_kN0x2I2weuiOQM0mKaI7'},
defined_tags={
'EXAMPLE_KEY_WeM6T': {
'EXAMPLE_KEY_8g8v2': 'EXAMPLE--Value'}}),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="MU5GWAOKTTKTTR0RSGXX<unique_ID>")
# Get the data from response
print(create_node_pool_response.headers)