# 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
from datetime import datetime
# 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_bridge_client = oci.cloud_bridge.InventoryClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_asset_response = cloud_bridge_client.update_asset(
asset_id="ocid1.test.oc1..<unique_ID>EXAMPLE-assetId-Value",
update_asset_details=oci.cloud_bridge.models.UpdateAwsEc2AssetDetails(
asset_type="AWS_EC2",
display_name="EXAMPLE-displayName-Value",
asset_source_ids=["EXAMPLE--Value"],
freeform_tags={
'EXAMPLE_KEY_GImxi': 'EXAMPLE_VALUE_iqnLYaWL5HRpv6T97KJ5'},
defined_tags={
'EXAMPLE_KEY_0DdRm': {
'EXAMPLE_KEY_oiwEb': 'EXAMPLE--Value'}},
compute=oci.cloud_bridge.models.ComputeProperties(
primary_ip="EXAMPLE-primaryIp-Value",
dns_name="EXAMPLE-dnsName-Value",
description="EXAMPLE-description-Value",
cores_count=958,
cpu_model="EXAMPLE-cpuModel-Value",
gpu_devices_count=681,
gpu_devices=[
oci.cloud_bridge.models.GpuDevice(
name="EXAMPLE-name-Value",
description="EXAMPLE-description-Value",
cores_count=105,
memory_in_mbs=352,
manufacturer="EXAMPLE-manufacturer-Value")],
threads_per_core_count=142,
memory_in_mbs=552,
is_pmem_enabled=True,
pmem_in_mbs=6,
operating_system="EXAMPLE-operatingSystem-Value",
operating_system_version="EXAMPLE-operatingSystemVersion-Value",
host_name="EXAMPLE-hostName-Value",
power_state="EXAMPLE-powerState-Value",
guest_state="EXAMPLE-guestState-Value",
is_tpm_enabled=False,
connected_networks=837,
nics_count=956,
nics=[
oci.cloud_bridge.models.Nic(
label="EXAMPLE-label-Value",
switch_name="EXAMPLE-switchName-Value",
mac_address="EXAMPLE-macAddress-Value",
mac_address_type="EXAMPLE-macAddressType-Value",
network_name="EXAMPLE-networkName-Value",
ip_addresses=["EXAMPLE--Value"])],
storage_provisioned_in_mbs=356,
disks_count=750,
disks=[
oci.cloud_bridge.models.Disk(
name="EXAMPLE-name-Value",
boot_order=191,
uuid="EXAMPLE-uuid-Value",
uuid_lun="EXAMPLE-uuidLun-Value",
size_in_mbs=933,
location="EXAMPLE-location-Value",
persistent_mode="EXAMPLE-persistentMode-Value",
is_cbt_enabled=False)],
firmware="EXAMPLE-firmware-Value",
latency_sensitivity="EXAMPLE-latencySensitivity-Value",
nvdimms=[
oci.cloud_bridge.models.Nvdimm(
label="EXAMPLE-label-Value",
unit_number=824,
controller_key=356)],
nvdimm_controller=oci.cloud_bridge.models.NvdimmController(
label="EXAMPLE-label-Value",
bus_number=381),
scsi_controller=oci.cloud_bridge.models.ScsiController(
label="EXAMPLE-label-Value",
unit_number=98,
shared_bus="EXAMPLE-sharedBus-Value"),
hardware_version="EXAMPLE-hardwareVersion-Value"),
vm=oci.cloud_bridge.models.VmProperties(
hypervisor_vendor="EXAMPLE-hypervisorVendor-Value",
hypervisor_version="EXAMPLE-hypervisorVersion-Value",
hypervisor_host="EXAMPLE-hypervisorHost-Value"),
aws_ec2=oci.cloud_bridge.models.AwsEc2Properties(
architecture="EXAMPLE-architecture-Value",
instance_key="EXAMPLE-instanceKey-Value",
instance_type="EXAMPLE-instanceType-Value",
root_device_name="EXAMPLE-rootDeviceName-Value",
state=oci.cloud_bridge.models.InstanceState(
code=872,
name="EXAMPLE-name-Value"),
boot_mode="EXAMPLE-bootMode-Value",
capacity_reservation_key="EXAMPLE-capacityReservationKey-Value",
are_elastic_inference_accelerators_present=False,
is_enclave_options=True,
is_hibernation_options=False,
image_key="EXAMPLE-imageKey-Value",
instance_lifecycle="EXAMPLE-instanceLifecycle-Value",
ip_address="EXAMPLE-ipAddress-Value",
ipv6_address="EXAMPLE-ipv6Address-Value",
kernel_key="EXAMPLE-kernelKey-Value",
time_launch=datetime.strptime(
"2021-11-13T11:03:19.983Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
licenses=["EXAMPLE--Value"],
maintenance_options="EXAMPLE-maintenanceOptions-Value",
monitoring="EXAMPLE-monitoring-Value",
network_interfaces=[
oci.cloud_bridge.models.InstanceNetworkInterface(
association=oci.cloud_bridge.models.InstanceNetworkInterfaceAssociation(
carrier_ip="EXAMPLE-carrierIp-Value",
customer_owned_ip="EXAMPLE-customerOwnedIp-Value",
ip_owner_key="EXAMPLE-ipOwnerKey-Value",
public_dns_name="EXAMPLE-publicDnsName-Value",
public_ip="EXAMPLE-publicIp-Value"),
attachment=oci.cloud_bridge.models.InstanceNetworkInterfaceAttachment(
attachment_key="EXAMPLE-attachmentKey-Value",
time_attach=datetime.strptime(
"2001-05-06T22:49:57.254Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
is_delete_on_termination=False,
device_index=137,
network_card_index=755,
status="EXAMPLE-status-Value"),
description="EXAMPLE-description-Value",
security_groups=[
oci.cloud_bridge.models.GroupIdentifier(
group_key="EXAMPLE-groupKey-Value",
group_name="EXAMPLE-groupName-Value")],
interface_type="EXAMPLE-interfaceType-Value",
ipv4_prefixes=["EXAMPLE--Value"],
ipv6_addresses=["EXAMPLE--Value"],
ipv6_prefixes=["EXAMPLE--Value"],
mac_address="EXAMPLE-macAddress-Value",
network_interface_key="EXAMPLE-networkInterfaceKey-Value",
owner_key="EXAMPLE-ownerKey-Value",
private_ip_addresses=[
oci.cloud_bridge.models.InstancePrivateIpAddress(
association=oci.cloud_bridge.models.InstanceNetworkInterfaceAssociation(
carrier_ip="EXAMPLE-carrierIp-Value",
customer_owned_ip="EXAMPLE-customerOwnedIp-Value",
ip_owner_key="EXAMPLE-ipOwnerKey-Value",
public_dns_name="EXAMPLE-publicDnsName-Value",
public_ip="EXAMPLE-publicIp-Value"),
is_primary=False,
private_dns_name="EXAMPLE-privateDnsName-Value",
private_ip_address="EXAMPLE-privateIpAddress-Value")],
is_source_dest_check=False,
status="EXAMPLE-status-Value",
subnet_key="EXAMPLE-subnetKey-Value")],
placement=oci.cloud_bridge.models.Placement(
affinity="EXAMPLE-affinity-Value",
availability_zone="EXAMPLE-availabilityZone-Value",
group_name="EXAMPLE-groupName-Value",
host_key="EXAMPLE-hostKey-Value",
host_resource_group_arn="EXAMPLE-hostResourceGroupArn-Value",
partition_number=330,
spread_domain="EXAMPLE-spreadDomain-Value",
tenancy="EXAMPLE-tenancy-Value"),
private_dns_name="EXAMPLE-privateDnsName-Value",
private_ip_address="EXAMPLE-privateIpAddress-Value",
root_device_type="EXAMPLE-rootDeviceType-Value",
security_groups=[
oci.cloud_bridge.models.GroupIdentifier(
group_key="EXAMPLE-groupKey-Value",
group_name="EXAMPLE-groupName-Value")],
is_source_dest_check=True,
is_spot_instance=True,
sriov_net_support="EXAMPLE-sriovNetSupport-Value",
subnet_key="EXAMPLE-subnetKey-Value",
tags=[
oci.cloud_bridge.models.Tag(
key="EXAMPLE-key-Value",
value="EXAMPLE-value-Value")],
tpm_support="EXAMPLE-tpmSupport-Value",
virtualization_type="EXAMPLE-virtualizationType-Value",
vpc_key="EXAMPLE-vpcKey-Value"),
aws_ec2_cost=oci.cloud_bridge.models.MonthlyCostSummary(
amount=241.84167,
currency_code="EXAMPLE-currencyCode-Value"),
attached_ebs_volumes_cost=oci.cloud_bridge.models.MonthlyCostSummary(
amount=9060.177,
currency_code="EXAMPLE-currencyCode-Value")),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="JPMRX6NX4RNHOVUBWHAA<unique_ID>")
# Get the data from response
print(update_asset_response.data)