Bug 1019211 - [RESTAPI] wrong VM link for Template's watchdog
[RESTAPI] wrong VM link for Template's watchdog
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.3.0
x86_64 Linux
high Severity high
: ---
: 3.3.0
Assigned To: Gilad Chaplik
Lukas Svaty
sla
: Triaged
Depends On:
Blocks: 3.3snap2
  Show dependency treegraph
 
Reported: 2013-10-15 05:56 EDT by Lukas Svaty
Modified: 2016-02-10 15:16 EST (History)
9 users (show)

See Also:
Fixed In Version: is22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 20529 None None None Never
oVirt gerrit 20708 None None None Never

  None (edit)
Description Lukas Svaty 2013-10-15 05:56:52 EDT
Description of problem:
adding watchdog to template is not supported via restapi returning HTTP Error code 405 Method not allowed

Version-Release number of selected component (if applicable):
is18

How reproducible:
100%

Steps to Reproduce:
1. Add/update watchdog via RESTAPI to template

Actual results:
HTML Error code 405

Expected results:
HTML code 200

Additional info:
curl -X POST -H "Accept: application/xml" -H 
"Content-Type: application/xml" -u admin@internal:123456 --cacert ca.crt -d "<watchdogs>
 <watchdog>
  <model>i6300esb</model>
  <action>reset</action>
 </watchdog>
</watchdogs>" 
https://ls-rhevm33.rhev.lab.eng.brq.redhat.com:443/api/templates/18e7869a-ae1a-4164-8b60-f71913014f0d/watchdogs

<html><head><title>JBoss Web/7.2.2.Final-redhat-1 - JBWEB000064: Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 405 - </h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000067: Status report</p><p><b>JBWEB000068: message</b> <u></u></p><p><b>JBWEB000069: description</b> <u>JBWEB000125: The specified HTTP method is not allowed for the requested resource.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.2.Final-redhat-1</h3></body></html>


also after adding watchdog to template in webadmin, api shows in 
/api/templates/18e7869a-ae1a-4164-8b60-f71913014f0d/watchdogs:

<watchdogs>
 <watchdog href="/api/vms/18e7869a-ae1a-4164-8b60-f71913014f0d/watchdogs/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000">
  <vm href="/api/vms/18e7869a-ae1a-4164-8b60-f71913014f0d" id="18e7869a-ae1a-4164-8b60-f71913014f0d"/>
  <model>i6300esb</model>
  <action>reset</action>
 </watchdog>
</watchdogs>

why is there a link to api/vms (href="/api/vms") in watchdog templates? and subelement vm?

also tried removing this watchdog from template in webadmin and trying to add it via RESTAPI with no success
Comment 1 Gilad Chaplik 2013-10-21 11:52:33 EDT
hi, 

Looks like an add/update should be performed on a single watchdog node (i.e. without <watchdogs></watchdogs> tags). can you verify (it works the same for vm and template).

For the second issue, I see there is a problem with it in the code. I'll consult Michael Pasternak, about it.

thanks :)
Comment 2 Lukas Svaty 2013-10-22 03:35:31 EDT
Verified the first part and it seems to be working. Watchdog added successfully to template when I removed <watchdogs> tags from HTTP request.

If the second part is OK with Michael this should be CLOSED as NOTABUG
Comment 3 Gilad Chaplik 2013-10-24 10:29:53 EDT
(In reply to Lukas Svaty from comment #2)
> Verified the first part and it seems to be working. Watchdog added
> successfully to template when I removed <watchdogs> tags from HTTP request.
> 
> If the second part is OK with Michael this should be CLOSED as NOTABUG

I guess that we can remove the needinfo, talked with Michael, and I'm uploading a fix for the second issue.
Also changing the bug title to sth less frightening :)
Comment 4 Lukas Svaty 2013-11-15 07:24:20 EST
tested in is23
Comment 5 Itamar Heim 2014-01-21 17:30:00 EST
Closing - RHEV 3.3 Released
Comment 6 Itamar Heim 2014-01-21 17:30:02 EST
Closing - RHEV 3.3 Released
Comment 7 Itamar Heim 2014-01-21 17:32:59 EST
Closing - RHEV 3.3 Released

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