Bug 1251900 - ovirt-java-sdk: missing imageImport function overload with correlation_id in java sdk
ovirt-java-sdk: missing imageImport function overload with correlation_id in ...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk-java (Show other bugs)
3.6.0
Unspecified Unspecified
unspecified Severity high
: ovirt-3.6.3
: 3.6.0
Assigned To: Daniel Erez
Raz Tamir
storage
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-10 05:17 EDT by Tareq Alayan
Modified: 2016-03-10 01:23 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-17 10:45:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 45096 master ABANDONED sdk: Change order of parameters of StorageDomain.importImage Never

  None (edit)
Description Tareq Alayan 2015-08-10 05:17:59 EDT
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 10:45:32 EDT
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 04:41:41 EDT
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 04:59:55 EDT
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 10:30:16 EDT
Yes, 

is it possible to change the order to (action, str correlation_id, bool async)
Comment 5 Juan Hernández 2015-08-19 11:04:57 EDT
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.

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