Bug 1008458 - RHEVM-SDK-JAVA: setupnetworks doesn't works
Summary: RHEVM-SDK-JAVA: setupnetworks doesn't works
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk-java
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.3.0
Assignee: Juan Hernández
QA Contact: Meni Yakove
URL:
Whiteboard: infra
Depends On:
Blocks: 1019461
TreeView+ depends on / blocked
 
Reported: 2013-09-16 11:51 UTC by Ilia Meerovich
Modified: 2016-07-05 00:07 UTC (History)
7 users (show)

Fixed In Version: is15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-21 22:11:08 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 19275 0 None None None Never

Description Ilia Meerovich 2013-09-16 11:51:09 UTC
wrong path to setupnetworks component.

Repo:
------------------------------------------------------------------------------
import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.ovirt.engine.sdk.Api;
import org.ovirt.engine.sdk.decorators.Host;
import org.ovirt.engine.sdk.decorators.HostNICs;
import org.ovirt.engine.sdk.entities.Action;
import org.ovirt.engine.sdk.exceptions.ServerException;
import org.ovirt.engine.sdk.exceptions.UnsecuredConnectionAttemptError;


public class foo {
        private static final String URL = "****:443/api";

    public static void main(String[] args) throws ClientProtocolException, ServerException,
            UnsecuredConnectionAttemptError, IOException {
        Api api = new Api(URL, "admin@internal", "*******", true);
        Host hst = (Host) api.getHosts().list().get(0);
        HostNICs hsn = hst.getHostNics();
        Action act = new Action();
        hst.getHostNics().setupnetworks(act);
       	//System.out.print(((org.ovirt.engine.sdk.entities.Host) api.getHosts().list().get(0)).getRebootAfterInstallation());
    }
}

you will get next exception:

Exception in thread "main" 
code  : 404
reason: Not Found
detail: <html><head><title>JBoss Web/7.2.0.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 404 - Could not find resource for relative : /hosts/cc9a016e-e34f-4ac8-b8cd-f27b462cf716/setupnetworks of full path: https://ilia-rhevm.qa.lab.tlv.redhat.com/api/hosts/cc9a016e-e34f-4ac8-b8cd-f27b462cf716/setupnetworks</h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000067: Status report</p><p><b>JBWEB000068: message</b> <u>Could not find resource for relative : /hosts/cc9a016e-e34f-4ac8-b8cd-f27b462cf716/setupnetworks of full path: https://ilia-rhevm.qa.lab.tlv.redhat.com/api/hosts/cc9a016e-e34f-4ac8-b8cd-f27b462cf716/setupnetworks</u></p><p><b>JBWEB000069: description</b> <u>JBWEB000124: The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.0.Final-redhat-1</h3></body></html>
	at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:118)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.add(HttpProxyBroker.java:209)
	at org.ovirt.engine.sdk.web.HttpProxyBroker.action(HttpProxyBroker.java:153)
	at org.ovirt.engine.sdk.decorators.HostNICs.setupnetworks(HostNICs.java:133)
	at foo.main(debugRemove.java:21)

Comment 2 Ilia Meerovich 2013-09-30 08:44:48 UTC
verified with is15

Comment 4 Itamar Heim 2014-01-21 22:11:08 UTC
Closing - RHEV 3.3 Released


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