Bug 1318261 - Python-SDK: add support for URL parameters in updates
Summary: Python-SDK: add support for URL parameters in updates
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk-python
Version: 3.6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.0.5
: 4.0.2
Assignee: Ondra Machacek
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On: 1318212
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-16 11:32 UTC by Juan Hernández
Modified: 2019-11-14 07:36 UTC (History)
12 users (show)

Fixed In Version: python-ovirt-engine-sdk4-4.0.2-1.el7ev
Doc Type: Bug Fix
Doc Text:
Clone Of: 1318212
Environment:
Last Closed: 2017-06-24 05:47:55 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Juan Hernández 2016-03-16 11:32:31 UTC
+++ This bug was initially created as a clone of Bug #1318212 +++

Description of problem:
When increasing VM memory via rhevm-shell. The default behaviour is to hot-plug the memory. This does not have to be possible due to the compatibility version for instance.

Version-Release number of selected component (if applicable):
rhevm-cli-3.6.2.0-1.el6ev

How reproducible:
100%

Steps to Reproduce:
1. Start a VM on a cluster with 3.5 compatibility version.
2. Try to updte the memory: update vm ${VM_NAME} --memort ${MEMORY_SIZE}

Actual results:
The memory is not updated and engine reports an error in the engine.log

Expected results:
Add possibility to set the memory for next run.

Additional info:
This is a regression as this was possible in RHEV 3.5

A possible way to achieve is via curl:

curl -X PUT -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin@internal:password --cacert /etc/pki/ovirt-engine/ca.pem -T data.xml 'https://rhevm36/ovirt-engine/api/vms/a774093d-fb09-4fb7-aff3-989d7c3755c1;next_run'

--- Additional comment from Juan Hernández on 2016-03-16 07:30:24 EDT ---

There are two reasons why this doesn't work. First is that the "next_run" parameter isn't documented in the metadata of the API, thus from the point of view of the generators of the SDKs it doesn't exist.

The second reason is that currently the Python SDK doesn't support URL parameters in "update" operations. The CLI obtains the description of the API inspecting the Python SDK. Thus, from the point of view of the CLI, the "next_run" parameter won't exist even if it is added to the metadata of the API. To support it the generator of the SDK will need to be improved to support URL parameters (similar to bug 1311495), then the SDK will need to be regenerated.

I'm moving the bug to the ovirt-engine component, so that we can add "next_run" to the documentation. Then I will clone this bug for the Python SDK.

Comment 1 Yaniv Lavi 2016-05-09 11:01:07 UTC
oVirt 4.0 Alpha has been released, moving to oVirt 4.0 Beta target.

Comment 5 Ondra Machacek 2016-10-04 12:29:05 UTC
Bug #1318212 was fixed for API version 4 only. So targeting this to Python SDK v4.

It's possible to send URL parameter as follows:

 vms_service = connection.system_service().vms_service()
 vm = vms_service.list(search='name=myvm')[0]
 vm_service = vms_service.vm_service(vm.id).get(next_run=True)

Comment 6 Lukas Svaty 2016-10-13 10:24:02 UTC
verified in 

enum34==1.1.6
ovirt-engine-sdk-python==4.0.2
pycurl==7.43.0
six==1.10.0


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