Bug 1008458

Summary: RHEVM-SDK-JAVA: setupnetworks doesn't works
Product: Red Hat Enterprise Virtualization Manager Reporter: Ilia Meerovich <iliam>
Component: ovirt-engine-sdk-javaAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Meni Yakove <myakove>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, juan.hernandez, myakove, oramraz, pstehlik, srevivo, yeylon
Target Milestone: ---Keywords: AutomationBlocker, TestBlocker
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 22:11:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1019461    

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