Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1145074 - [Docs][Change][Technical]The example for ejecting the current CD-ROM using RESTAPI isn't correct
[Docs][Change][Technical]The example for ejecting the current CD-ROM using RE...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation (Show other bugs)
3.3.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tahlia Richardson
Andrew Burden
:
: 1089782 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-22 06:34 EDT by Juan Hernández
Modified: 2015-02-15 18:59 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-15 18:59:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Juan Hernández 2014-09-22 06:34:50 EDT
The correct way to eject a CDROM (see [1], example 26.26) is to use the PUT method with an empty "file.id":

PUT /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000;current=true HTTP/1.1
Accept: application/xml
Content-type: application/xml
<cdrom>
  <file id=""/>
</cdrom>

[1] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5-Beta/html/Technical_Guide/Virtual_Machine_CD-ROMs_Sub-Collection.html
Comment 1 Julie 2014-09-23 04:05:10 EDT
 (In reply to Juan Hernández from comment #0)
> The correct way to eject a CDROM (see [1], example 26.26) is to use the PUT
> method with an empty "file.id":
> 
> PUT
> /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-
> 000000000000;current=true HTTP/1.1
> Accept: application/xml
> Content-type: application/xml
> <cdrom>
>   <file id=""/>
> </cdrom>
> 
> [1]
> https://access.redhat.com/documentation/en-US/
> Red_Hat_Enterprise_Virtualization/3.5-Beta/html/Technical_Guide/
> Virtual_Machine_CD-ROMs_Sub-Collection.html

Hi Juan,
   Thanks for filing this bug. If you could provide us with a correct example, it will speed up our time to get this fix out. Could you kindly provide us with a correct example? (There should be an 'expected result' section in the template for bug creation)

Many thanks, 
Julie
Comment 2 Juan Hernández 2014-09-23 04:38:11 EDT
Currently the example 29.26 reads as follows:

"Send a DELETE request to the cdroms sub-collection of a virtual machine to remove the CD-ROM from a virtual machine:
⁠
Example 29.26. Removing a CD-ROM file during a current session

DELETE /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000 HTTP/1.1
Accept: application/xml
Content-type: application/xml"

But isn't correct, or confusing, because what it is doing is persistently disconnecting the CD-ROM from the virtual machine, not only during the current session. The correct way to remove the CD-ROM during the current session is to use a PUT request with the current=True matrix parameter and an empty file identifier. So, in my opinion, the example should read as follows:

"To eject the CD-ROM send a PUT request to the CD-ROM sub-collection of a virtual machine, adding the current=True matrix parameter:

Example 29.26. Ejecting a CD-ROM during the current session

PUT /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000;current=true HTTP/1.1
Accept: application/xml
Content-type: application/xml
<cdrom>
  <file id=""/>
</cdrom>

Note that this will disconnect the CD-ROM from the virtual machine only temporarely, rebooting the virtual machine will connect it again."

You may want to preserve the original example, but I'd suggest that you explicitly indicate that it disconnects the CD-ROM from the virtual machine persistently, not only during the current session. In addition I think that it is bad practice to use the DELETE request for this, so if you are keeping this example I'd suggest to rewrite it as follows:

"To eject the CD-ROM send a PUT request to the CD-ROM sub-collection of a virtual machine:

Example 29.26. Ejecting a CD-ROM permanently

PUT /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000 HTTP/1.1
Accept: application/xml
Content-type: application/xml
<cdrom>
  <file id=""/>
</cdrom>

Note that this will permanently disconnect the CD-ROM from the virtual machine."
Comment 3 Julie 2014-09-23 05:20:11 EDT
Thanks for the info, Juan.
Once the documentation gets updated, you will be need_info for confirmation.

Cheers,
Julie
Comment 4 Julie 2014-09-23 23:36:35 EDT
*** Bug 1089782 has been marked as a duplicate of this bug. ***
Comment 6 Tahlia Richardson 2014-10-07 02:35:57 EDT
Hi Juan, 

I've updated this section to correct the existing example, and added a further example. Can you please review to confirm its correctness? 

Thanks,
Tahlia


Documentation Link 
------------------------------
https://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5/html-single/Technical_Guide/index.html#Virtual_Machine_CD-ROMs_Sub-Collection
Comment 7 Juan Hernández 2014-10-07 03:59:35 EDT
The updated document looks good to me. I just would suggest to use current=true in example 29.25. the "=true" part isn't required, as it is the default, but it is good practice to make it explicit.
Comment 8 Tahlia Richardson 2014-10-07 20:29:12 EDT
Documentation Link 
------------------------------
https://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.5/html-single/Technical_Guide/index.html#Virtual_Machine_CD-ROMs_Sub-Collection


What Changed 
------------------------------

CD-ROMs Sub-Collection [7992-714716]

Corrected the example for ejecting a CD-ROM during the current session, to:
----
PUT /api/vms/cdc0b102-fbfe-444a-b9cb-57d2af94f401/cdroms/00000000-0000-0000-0000-000000000000;current=true HTTP/1.1
Accept: application/xml
Content-type: application/xml
<cdrom>
  <file id=""/>
</cdrom>
----

And added an example for ejecting a CD-ROM permanently.

**I've also added current=true to example 29.25, but haven't rebuilt yet since it wasn't part of the original bug request. It will be in the next build, though. [7992-715438]

Updated revision history [34616-715259]


NVR
------------------------------
Red_Hat_Enterprise_Virtualization-Technical_Guide-3.5-web-en-US-3.5-17.el6eng


Moving to ON_QA

Note You need to log in before you can comment on or make changes to this bug.