VMware, Inc.
85
Chapter 5 Datacenter Operations
List Media Devices of a Virtual Machine
You
can
make
a
GET
request
to
the
media
URL
of
a
Vm
to
return
a
list
of
all
media
devices
attached
to
it.
Example 5-28.
List Media Devices Attached to a Vm
Request:
GET http://vcloud.example.com/api/v1.0/vapp/vm-5/virtualHardwareSection/media
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.rasditxml
...
<RasdItemsList xmlns="http://www.vmware.com/vcloud/v1" ...
href="http://vcloud.example.com/api/v1.0/vApp/vm-5/virtualHardwareSection/media" ... >
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>IDE Controller 0</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Description>CD/DVD Drive</rasd:Description>
<rasd:ElementName>CD/DVD Drive 1</rasd:ElementName>
<rasd:HostResource xmlns:vcloud="http://www.vmware.com/vcloud/v1"
vcloud:connected="false"></rasd:HostResource>
<rasd:InstanceID>3000</rasd:InstanceID>
<rasd:Parent>1</rasd:Parent>
<rasd:ResourceType>15</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Description>Floppy Drive</rasd:Description>
<rasd:ElementName>Floppy Drive 1</rasd:ElementName>
<rasd:HostResource xmlns:vcloud="http://www.vmware.com/vcloud/v1"
vcloud:connected="false"></rasd:HostResource>
<rasd:InstanceID>8000</rasd:InstanceID>
<rasd:ResourceType>14</rasd:ResourceType>
</Item>
</RasdItemsList>
Insert Media Into a Virtual Machine
An
insertMedia
request
makes
a
virtual
media
image
readable
by
a
Vm
.
The
request
must
specify
the
insertMedia
URL
of
a
Vm
.
The
Media
element
in
the
request
body
must
specify
the
href
of
the
media
image
to
insert.
When
processing
an
insertMedia
request,
the
server
examines
the
type
of
the
media
specified
in
the
request
and
then
attempts
to
insert
it
in
a
device
of
the
appropriate
type,
starting
with
the
device
that
has
the
lowest
bus
number
and
lowest
address
on
that
bus.
Example 5-29.
Insert Media Into a Virtual Machine
Request:
POST http://vcloud.example.com/api/v1.0/vapp/vm-5/media/action/insertMedia
Content-Type: application/vnd.vmware.vcloud.mediaInsertOrEjecxml
<MediaInsertOrEjectParams xmlns="http://www.vmware.com/vcloud/v1">
<Media href="http://vcloud.example.com/api/v1.0/media/3"/>
</MediaInsertOrEjectParams>
Summary of Contents for VCLOUD API 1.0 - TECHNICAL NOTE
Page 10: ...vCloud API Programming Guide 10 VMware Inc...
Page 20: ...vCloud API Programming Guide 20 VMware Inc...
Page 32: ...vCloud API Programming Guide 32 VMware Inc...
Page 90: ...vCloud API Programming Guide 90 VMware Inc...
Page 150: ...vCloud API Programming Guide 150 VMware Inc...
Page 170: ...vCloud API Programming Guide 170 VMware Inc...