# 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(
defined_tags={
'EXAMPLE_KEY_pNj2Z': {
'EXAMPLE_KEY_UNp1o': 'EXAMPLE--Value'}},
display_name="EXAMPLE-displayName-Value",
freeform_tags={
'EXAMPLE_KEY_Nft6a': 'EXAMPLE_VALUE_zKzYoYbDNqzHzETETv70'},
agent_config=oci.core.models.UpdateInstanceAgentConfigDetails(
is_monitoring_disabled=False,
is_management_disabled=False,
are_all_plugins_disabled=False,
plugins_config=[
oci.core.models.InstanceAgentPluginConfigDetails(
name="EXAMPLE-name-Value",
desired_state="ENABLED")]),
metadata={
'EXAMPLE_KEY_NV5XR': 'EXAMPLE_VALUE_TsN5qiyry7Yw9wzb0YGY'},
extended_metadata={
'EXAMPLE_KEY_Ebbvm': 'EXAMPLE--Value'},
shape="EXAMPLE-shape-Value",
shape_config=oci.core.models.UpdateInstanceShapeConfigDetails(
ocpus=9616.049,
memory_in_gbs=8919.806),
instance_options=oci.core.models.InstanceOptions(
are_legacy_imds_endpoints_disabled=False),
fault_domain="EXAMPLE-faultDomain-Value",
launch_options=oci.core.models.UpdateLaunchOptions(
boot_volume_type="ISCSI",
network_type="VFIO",
is_pv_encryption_in_transit_enabled=False),
availability_config=oci.core.models.UpdateInstanceAvailabilityConfigDetails(
recovery_action="RESTORE_INSTANCE")),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
if_match="EXAMPLE-ifMatch-Value")
# Get the data from response
print(update_instance_response.data)