# 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
cloud_migrations_client = oci.cloud_migrations.MigrationClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_target_asset_response = cloud_migrations_client.update_target_asset(
target_asset_id="ocid1.test.oc1..<unique_ID>EXAMPLE-targetAssetId-Value",
update_target_asset_details=oci.cloud_migrations.models.UpdateVmTargetAssetDetails(
type="INSTANCE",
is_excluded_from_execution=False,
preferred_shape_type="VM",
block_volumes_performance=765,
ms_license="EXAMPLE-msLicense-Value",
user_spec=oci.cloud_migrations.models.LaunchInstanceDetails(
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.cloud_migrations.models.CreateVnicDetails(
assign_public_ip=True,
assign_private_dns_record=True,
defined_tags={
'EXAMPLE_KEY_J7VYM': {
'EXAMPLE_KEY_EWXud': 'EXAMPLE--Value'}},
display_name="EXAMPLE-displayName-Value",
freeform_tags={
'EXAMPLE_KEY_SAFEu': 'EXAMPLE_VALUE_XlMjDOqC6rerlBrYaCS3'},
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",
vlan_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value"),
dedicated_vm_host_id="ocid1.test.oc1..<unique_ID>EXAMPLE-dedicatedVmHostId-Value",
defined_tags={
'EXAMPLE_KEY_buO29': {
'EXAMPLE_KEY_lFXo5': 'EXAMPLE--Value'}},
display_name="EXAMPLE-displayName-Value",
fault_domain="EXAMPLE-faultDomain-Value",
freeform_tags={
'EXAMPLE_KEY_iSI6T': 'EXAMPLE_VALUE_pTCtdNGmOq2U0o3Kjj5N'},
hostname_label="EXAMPLE-hostnameLabel-Value",
ipxe_script="EXAMPLE-ipxeScript-Value",
instance_options=oci.cloud_migrations.models.InstanceOptions(
are_legacy_imds_endpoints_disabled=False),
preemptible_instance_config=oci.cloud_migrations.models.PreemptibleInstanceConfigDetails(
preemption_action=oci.cloud_migrations.models.TerminatePreemptionAction(
type="TERMINATE",
preserve_boot_volume=False)),
agent_config=oci.cloud_migrations.models.LaunchInstanceAgentConfigDetails(
is_monitoring_disabled=False,
is_management_disabled=True,
are_all_plugins_disabled=False,
plugins_config=[
oci.cloud_migrations.models.InstanceAgentPluginConfigDetails(
name="EXAMPLE-name-Value",
desired_state="ENABLED")]),
shape="EXAMPLE-shape-Value",
shape_config=oci.cloud_migrations.models.LaunchInstanceShapeConfigDetails(
ocpus=5409.1167,
memory_in_gbs=3648.6501,
baseline_ocpu_utilization="BASELINE_1_2"),
source_details=oci.cloud_migrations.models.InstanceSourceViaBootVolumeDetails(
source_type="bootVolume",
boot_volume_id="ocid1.test.oc1..<unique_ID>EXAMPLE-bootVolumeId-Value"),
is_pv_encryption_in_transit_enabled=False)),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="I1AHWXTFIPUCSBTGB5EE<unique_ID>")
# Get the data from response
print(update_target_asset_response.headers)