# 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).
require '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::ConfigFileLoader.load_config
# Initialize service client with default config file
cloud_bridge_client = OCI::CloudBridge::InventoryClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_asset_response =
cloud_bridge_client.create_asset(
OCI::CloudBridge::Models::CreateVmwareVmAssetDetails.new(
asset_type: 'VMWARE_VM',
inventory_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-inventoryId-Value',
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
source_key: 'EXAMPLE-sourceKey-Value',
external_asset_key: 'EXAMPLE-externalAssetKey-Value',
display_name: 'EXAMPLE-displayName-Value',
asset_source_ids: %w[EXAMPLE--Value],
freeform_tags: {
'EXAMPLE_KEY_Ku4pP' => 'EXAMPLE_VALUE_X6MxrQvUnoERZMrhSn0h'
},
defined_tags: {
'EXAMPLE_KEY_GtNtx' => { 'EXAMPLE_KEY_qjkY6' => 'EXAMPLE--Value' }
},
compute:
OCI::CloudBridge::Models::ComputeProperties.new(
primary_ip: 'EXAMPLE-primaryIp-Value',
dns_name: 'EXAMPLE-dnsName-Value',
description: 'EXAMPLE-description-Value',
cores_count: 800,
cpu_model: 'EXAMPLE-cpuModel-Value',
gpu_devices_count: 357,
gpu_devices: [
OCI::CloudBridge::Models::GpuDevice.new(
name: 'EXAMPLE-name-Value',
description: 'EXAMPLE-description-Value',
cores_count: 32,
memory_in_mbs: 263,
manufacturer: 'EXAMPLE-manufacturer-Value'
)
],
threads_per_core_count: 409,
memory_in_mbs: 814,
is_pmem_enabled: false,
pmem_in_mbs: 793,
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: true,
connected_networks: 46,
nics_count: 206,
nics: [
OCI::CloudBridge::Models::Nic.new(
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: %w[EXAMPLE--Value]
)
],
storage_provisioned_in_mbs: 6,
disks_count: 986,
disks: [
OCI::CloudBridge::Models::Disk.new(
name: 'EXAMPLE-name-Value',
boot_order: 232,
uuid: 'EXAMPLE-uuid-Value',
uuid_lun: 'EXAMPLE-uuidLun-Value',
size_in_mbs: 202,
location: 'EXAMPLE-location-Value',
persistent_mode: 'EXAMPLE-persistentMode-Value'
)
],
firmware: 'EXAMPLE-firmware-Value',
latency_sensitivity: 'EXAMPLE-latencySensitivity-Value',
nvdimms: [
OCI::CloudBridge::Models::Nvdimm.new(
label: 'EXAMPLE-label-Value',
unit_number: 703,
controller_key: 895
)
],
nvdimm_controller:
OCI::CloudBridge::Models::NvdimmController.new(
label: 'EXAMPLE-label-Value', bus_number: 857
),
scsi_controller:
OCI::CloudBridge::Models::ScsiController.new(
label: 'EXAMPLE-label-Value',
unit_number: 0,
shared_bus: 'EXAMPLE-sharedBus-Value'
),
hardware_version: 'EXAMPLE-hardwareVersion-Value'
),
vm:
OCI::CloudBridge::Models::VmProperties.new(
hypervisor_vendor: 'EXAMPLE-hypervisorVendor-Value',
hypervisor_version: 'EXAMPLE-hypervisorVersion-Value',
hypervisor_host: 'EXAMPLE-hypervisorHost-Value'
),
vmware_vm:
OCI::CloudBridge::Models::VmwareVmProperties.new(
cluster: 'EXAMPLE-cluster-Value',
customer_fields: %w[EXAMPLE--Value],
customer_tags: [
OCI::CloudBridge::Models::CustomerTag.new(
name: 'EXAMPLE-name-Value',
description: 'EXAMPLE-description-Value'
)
],
instance_uuid: 'EXAMPLE-instanceUuid-Value',
path: 'EXAMPLE-path-Value',
vmware_tools_status: 'EXAMPLE-vmwareToolsStatus-Value',
is_disks_uuid_enabled: true,
is_disks_cbt_enabled: true,
fault_tolerance_state: 'EXAMPLE-faultToleranceState-Value',
fault_tolerance_bandwidth: 180,
fault_tolerance_secondary_latency: 578
),
vmware_v_center:
OCI::CloudBridge::Models::VmwareVCenterProperties.new(
vcenter_key: 'EXAMPLE-vcenterKey-Value',
vcenter_version: 'EXAMPLE-vcenterVersion-Value',
data_center: 'EXAMPLE-dataCenter-Value'
)
)
)
# Get the data from response
puts "#{create_asset_response.data}"