Bug 1251900

Summary: ovirt-java-sdk: missing imageImport function overload with correlation_id in java sdk
Product: Red Hat Enterprise Virtualization Manager Reporter: Tareq Alayan <talayan>
Component: ovirt-engine-sdk-javaAssignee: Daniel Erez <derez>
Status: CLOSED NOTABUG QA Contact: Raz Tamir <ratamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: acanan, amureini, ecohen, gklein, juan.hernandez, lsurette, yeylon
Target Milestone: ovirt-3.6.3   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-17 14:45:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tareq Alayan 2015-08-10 09:17:59 UTC
Description of problem:
There is one available function in which we can import an image from a glance repository.

Class StorageDomainImage
Method: Action importImage(Action action)

it is very important to our automation code to have 
Action importImage(Action action, string correlationId)

Version-Release number of selected component (if applicable):
ovirt-engine-sdk-java-3.6.0.0-0.15.20150724.git2543969.el6.noarch.rpm

Comment 1 Juan Hernández 2015-08-17 14:45:32 UTC
The latest version of the Java SDK (3.6.0.0-0.15, same that you are using) already contains an "importImage" method with a "correlationId" parameter:

  https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk-java.git;a=blob;f=sdk/src/main/java/org/ovirt/engine/sdk/decorators/StorageDomainImage.java;h=da6758ebd243f01f3a9bb0c4615d001246dba75a;hb=HEAD#l176

  public Action importImage(Action action, Boolean async, String correlationId) {
     ...
  }

Comment 2 Tareq Alayan 2015-08-18 08:41:41 UTC
Juan,
in java doc 
Name        : ovirt-engine-sdk-java-javadoc
Arch        : noarch
Version     : 3.6.0.0
Release     : 0.720150409.git14b3c31.el6
Size        : 4.1 M
Repo        : installed
From repo   : ovirt-master-snapshot
Summary     : Javadocs for ovirt-engine-sdk-java
URL         : http://ovirt.org
License     : ASL 2.0
Description : This package contains the API documentation for ovirt-engine-sdk-java.


public Action importImage(Action action)
                   throws org.apache.http.client.ClientProtocolException,
                          ServerException,
                          IOException
Performs importImage action.
Parameters:
action - Action
Returns:
Action



and it fails when automation since it misses the exepected function overload.
java_sdk.VERSION
'3.6.0.0.0.15.20150724.2543969'

Comment 3 Juan Hernández 2015-08-18 08:59:55 UTC
That version of the Javadoc is old, it corresponds to version 3.6.0.0-0.7 of the SDK, and you are using 3.6.0.0-0.15.

You can verify that the method exists in the SDK that you have installed with the following command:

  $ javap -cp /usr/share/java/ovirt-engine-sdk-java/ovirt-engine-sdk-java.jar org.ovirt.engine.sdk.decorators.StorageDomainImage | grep importImage

Note that the relevant method has three paremeters: action, async and correlationId. Can it be that the automation frameworks expects them in a different order?

Comment 4 Tareq Alayan 2015-08-19 14:30:16 UTC
Yes, 

is it possible to change the order to (action, str correlation_id, bool async)

Comment 5 Juan Hernández 2015-08-19 15:04:57 UTC
Yes, it is possible, something like this:

  https://gerrit.ovirt.org/45096
  sdk: Change order of parameters of StorageDomain.importImage

However the current order (alphabetical) is the default order for all new methods. This means that if a new action is added in the future, to any resource, it will be ordered as "async" and then "correlationId". So the testing framework will have to eventually deal with this, I think it is better if you handle it now.