Bug 1013301 - RHEVM Backend: Bad request error doesn't returns enough details (cannot understand from the error what was bad/missing in request)
RHEVM Backend: Bad request error doesn't returns enough details (cannot under...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.3.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.3.0
Assigned To: Eli Mesika
Ilia Meerovich
infra
:
Depends On:
Blocks: 1019461 3.3snap2
  Show dependency treegraph
 
Reported: 2013-09-29 03:42 EDT by Ilia Meerovich
Modified: 2016-02-10 14:17 EST (History)
9 users (show)

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


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 19676 None None None Never
oVirt gerrit 20831 None None None Never

  None (edit)
Description Ilia Meerovich 2013-09-29 03:42:08 EDT
import org.ovirt.engine.sdk.Api;
import org.ovirt.engine.sdk.decorators.Host;
import org.ovirt.engine.sdk.entities.PowerManagement;


public class debugRemove {
        private static final String URL = "https://ilia-rhevm.qa.lab.tlv.redhat.com:443/api";

    public static void main(String[] args) throws Exception {
        Api api = new Api(URL, "admin@internal", "123456", true);
        Host hst = (Host) api.getHosts().list().get(0);
        PowerManagement pm = new PowerManagement();
        pm.setType("apc");
        Boolean bl = new Boolean("true");
        pm.setEnabled(bl);
        hst.setPowerManagement(pm);
        hst.update();
        api.close();
    }
}

raises next exception:
Exception in thread "main" 
code  : 400
reason: Bad Request
detail: may not be null
	at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.update(HttpProxyBroker.java:104)
	at org.ovirt.engine.sdk.decorators.Host.update(Host.java:390)
	at debugRemove.main(debugRemove.java:17)
Comment 1 Ilia Meerovich 2013-11-17 10:58:59 EST
verified with is23, now getting meaningful message:

Exception in thread "main" 
code  : 400
reason: Bad Request
detail: Cannot edit Host. Power Management is enabled for Host but Agent credentials are missing.
	at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.update(HttpProxyBroker.java:104)
	at org.ovirt.engine.sdk.decorators.Host.update(Host.java:398)
	at java_sdk_testing.JavaSDKTestDebug.main(JavaSDKTestDebug.java:19)
Comment 2 Itamar Heim 2014-01-21 17:16:40 EST
Closing - RHEV 3.3 Released
Comment 3 Itamar Heim 2014-01-21 17:23:24 EST
Closing - RHEV 3.3 Released

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