Quantcast
Channel: VMware Communities : Discussion List - VMware vCloud Director
Viewing all articles
Browse latest Browse all 4515

vCD API: How to determine href of inserted media?

$
0
0

According to the documentation to eject a media from a VM we need

1. a link: POST /vApp/{id}/media/action/ejectMedia

2. a reference to a media we want to eject


However all we can find about the attached media in the VM's xml is its name.

GET /vApp/{id}/virtualHardwareSection/media

<Item>     <rasd:AddressOnParent>0</rasd:AddressOnParent>     <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>     <rasd:Description>CD/DVD Drive</rasd:Description>     <rasd:ElementName>CD/DVD Drive 1</rasd:ElementName>     <rasd:HostResource>test_disk.iso</rasd:HostResource>     <rasd:InstanceID>3002</rasd:InstanceID>     <rasd:Parent>2</rasd:Parent>     <rasd:ResourceSubType>vmware.cdrom.iso</rasd:ResourceSubType>     <rasd:ResourceType>15</rasd:ResourceType></Item>

 

So, to get an href for the "test_disk.iso" we need to go through available catalogs and look for a media with name "test_disk.iso". But likely you have more than one catalog and there's high probability they could have medias with the same name. No surprise in this case search by name won't work.

 

And here comes my question. Is there a way to determine an href of a media that is attached to a VM?


Viewing all articles
Browse latest Browse all 4515

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>