# 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.ComputeClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_instance_response = core_client.update_instance(
    instance_id="ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value",
    update_instance_details=oci.core.models.UpdateInstanceDetails(
        capacity_reservation_id="ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
        defined_tags={
            'EXAMPLE_KEY_0GHOi': {
                'EXAMPLE_KEY_yoDr4': 'EXAMPLE--Value'}},
        display_name="EXAMPLE-displayName-Value",
        freeform_tags={
            'EXAMPLE_KEY_shRk5': 'EXAMPLE_VALUE_en7vqoavr3yBzpQkKRqE'},
        agent_config=oci.core.models.UpdateInstanceAgentConfigDetails(
            is_monitoring_disabled=True,
            is_management_disabled=True,
            are_all_plugins_disabled=True,
            plugins_config=[
                oci.core.models.InstanceAgentPluginConfigDetails(
                    name="EXAMPLE-name-Value",
                    desired_state="ENABLED")]),
        metadata={
            'EXAMPLE_KEY_M9FUm': 'EXAMPLE_VALUE_fLmh4TAmhvS95Oi2lW1n'},
        extended_metadata={
            'EXAMPLE_KEY_2eMFG': 'EXAMPLE--Value'},
        shape="EXAMPLE-shape-Value",
        shape_config=oci.core.models.UpdateInstanceShapeConfigDetails(
            ocpus=4303.4204,
            memory_in_gbs=194.07153,
            baseline_ocpu_utilization="BASELINE_1_2"),
        instance_options=oci.core.models.InstanceOptions(
            are_legacy_imds_endpoints_disabled=True),
        fault_domain="EXAMPLE-faultDomain-Value",
        launch_options=oci.core.models.UpdateLaunchOptions(
            boot_volume_type="ISCSI",
            network_type="VFIO",
            is_pv_encryption_in_transit_enabled=True),
        availability_config=oci.core.models.UpdateInstanceAvailabilityConfigDetails(
            is_live_migration_preferred=False,
            recovery_action="STOP_INSTANCE")),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    if_match="EXAMPLE-ifMatch-Value")

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