# 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
core_client = oci.core.ComputeManagementClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
launch_instance_configuration_response = core_client.launch_instance_configuration(
    instance_configuration_id="ocid1.test.oc1..<unique_ID>EXAMPLE-instanceConfigurationId-Value",
    instance_configuration=oci.core.models.ComputeInstanceDetails(
        instance_type="compute",
        block_volumes=[
            oci.core.models.InstanceConfigurationBlockVolumeDetails(
                attach_details=oci.core.models.InstanceConfigurationParavirtualizedAttachVolumeDetails(
                    type="paravirtualized",
                    display_name="EXAMPLE-displayName-Value",
                    is_read_only=False,
                    device="EXAMPLE-device-Value",
                    is_shareable=False,
                    is_pv_encryption_in_transit_enabled=False),
                create_details=oci.core.models.InstanceConfigurationCreateVolumeDetails(
                    availability_domain="EXAMPLE-availabilityDomain-Value",
                    backup_policy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-backupPolicyId-Value",
                    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                    defined_tags={
                        'EXAMPLE_KEY_ExeDI': {
                            'EXAMPLE_KEY_CF8Xh': 'EXAMPLE--Value'}},
                    display_name="EXAMPLE-displayName-Value",
                    freeform_tags={
                        'EXAMPLE_KEY_siEcd': 'EXAMPLE_VALUE_QS4b7OkpRmIajrDzGZUb'},
                    kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
                    vpus_per_gb=780,
                    size_in_gbs=622,
                    source_details=oci.core.models.InstanceConfigurationVolumeSourceFromVolumeBackupDetails(
                        type="volumeBackup",
                        id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value")),
                volume_id="ocid1.test.oc1..<unique_ID>EXAMPLE-volumeId-Value")],
        launch_details=oci.core.models.InstanceConfigurationLaunchInstanceDetails(
            availability_domain="EXAMPLE-availabilityDomain-Value",
            capacity_reservation_id="ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
            compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
            create_vnic_details=oci.core.models.InstanceConfigurationCreateVnicDetails(
                assign_public_ip=True,
                assign_private_dns_record=False,
                defined_tags={
                    'EXAMPLE_KEY_3Kk0a': {
                        'EXAMPLE_KEY_6HeJr': 'EXAMPLE--Value'}},
                display_name="EXAMPLE-displayName-Value",
                freeform_tags={
                    'EXAMPLE_KEY_VkO8m': 'EXAMPLE_VALUE_fqo2QlfdCb1PxTy43n4k'},
                hostname_label="EXAMPLE-hostnameLabel-Value",
                nsg_ids=["EXAMPLE--Value"],
                private_ip="EXAMPLE-privateIp-Value",
                skip_source_dest_check=True,
                subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
            defined_tags={
                'EXAMPLE_KEY_JPaY0': {
                    'EXAMPLE_KEY_fcWyD': 'EXAMPLE--Value'}},
            display_name="EXAMPLE-displayName-Value",
            extended_metadata={
                'EXAMPLE_KEY_ksxEF': 'EXAMPLE--Value'},
            freeform_tags={
                'EXAMPLE_KEY_CxWJN': 'EXAMPLE_VALUE_cVDuihYapy7Y8Jc4nXu9'},
            ipxe_script="EXAMPLE-ipxeScript-Value",
            metadata={
                'EXAMPLE_KEY_OIwMY': 'EXAMPLE_VALUE_AxCRtrfyFgseaaB4gf8l'},
            shape="EXAMPLE-shape-Value",
            shape_config=oci.core.models.InstanceConfigurationLaunchInstanceShapeConfigDetails(
                ocpus=5735.073,
                memory_in_gbs=4531.135,
                baseline_ocpu_utilization="BASELINE_1_1"),
            platform_config=oci.core.models.InstanceConfigurationIntelVmLaunchInstancePlatformConfig(
                type="INTEL_VM",
                is_secure_boot_enabled=True,
                is_trusted_platform_module_enabled=False,
                is_measured_boot_enabled=True),
            source_details=oci.core.models.InstanceConfigurationInstanceSourceViaImageDetails(
                source_type="image",
                boot_volume_size_in_gbs=229,
                image_id="ocid1.test.oc1..<unique_ID>EXAMPLE-imageId-Value"),
            fault_domain="EXAMPLE-faultDomain-Value",
            dedicated_vm_host_id="ocid1.test.oc1..<unique_ID>EXAMPLE-dedicatedVmHostId-Value",
            launch_mode="CUSTOM",
            launch_options=oci.core.models.InstanceConfigurationLaunchOptions(
                boot_volume_type="VFIO",
                firmware="UEFI_64",
                network_type="E1000",
                remote_data_volume_type="IDE",
                is_pv_encryption_in_transit_enabled=True,
                is_consistent_volume_naming_enabled=False),
            agent_config=oci.core.models.InstanceConfigurationLaunchInstanceAgentConfigDetails(
                is_monitoring_disabled=True,
                is_management_disabled=False,
                are_all_plugins_disabled=True,
                plugins_config=[
                    oci.core.models.InstanceAgentPluginConfigDetails(
                        name="EXAMPLE-name-Value",
                        desired_state="DISABLED")]),
            is_pv_encryption_in_transit_enabled=False,
            preferred_maintenance_action="REBOOT",
            instance_options=oci.core.models.InstanceConfigurationInstanceOptions(
                are_legacy_imds_endpoints_disabled=True),
            availability_config=oci.core.models.InstanceConfigurationAvailabilityConfig(
                recovery_action="STOP_INSTANCE"),
            preemptible_instance_config=oci.core.models.PreemptibleInstanceConfigDetails(
                preemption_action=oci.core.models.TerminatePreemptionAction(
                    type="TERMINATE",
                    preserve_boot_volume=True))),
        secondary_vnics=[
            oci.core.models.InstanceConfigurationAttachVnicDetails(
                create_vnic_details=oci.core.models.InstanceConfigurationCreateVnicDetails(
                    assign_public_ip=True,
                    assign_private_dns_record=False,
                    defined_tags={
                        'EXAMPLE_KEY_WBDDc': {
                            'EXAMPLE_KEY_69uhD': 'EXAMPLE--Value'}},
                    display_name="EXAMPLE-displayName-Value",
                    freeform_tags={
                        'EXAMPLE_KEY_N91aD': 'EXAMPLE_VALUE_7NFuinernrwN0jLfSviH'},
                    hostname_label="EXAMPLE-hostnameLabel-Value",
                    nsg_ids=["EXAMPLE--Value"],
                    private_ip="EXAMPLE-privateIp-Value",
                    skip_source_dest_check=True,
                    subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
                display_name="EXAMPLE-displayName-Value",
                nic_index=288)]),
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(launch_instance_configuration_response.data)