Bug 1118329 - Can't change power management type using REST-API
Summary: Can't change power management type using REST-API
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.6.0
Assignee: Ori Liel
QA Contact:
Whiteboard: infra
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-10 13:00 UTC by sefi litmanovich
Modified: 2016-02-10 19:19 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-04-08 07:22:03 UTC
oVirt Team: Infra
Target Upstream Version:

Attachments (Terms of Use)

Description sefi litmanovich 2014-07-10 13:00:39 UTC
Description of problem:

if a power management agent is configured with agent type A and I want to change it to type B using REST-API, until now I would issue this call:

PUT request content is --  url:/api/hosts/{host_id}

    <power_management type="apc_snmp">

Steps to Reproduce:
1.add a host.
2.enable power management and provide address, username, password and type for it.
3.try to change the type of the agent using the above call.

Actual results:

Response code = 400

fails with message:

<reason>Operation Failed</reason>
<detail>[Cannot edit Host. Power Management is enabled for Host but no Agent type selected.]</detail>

Expected results:

the agent type changes according to the new type.

Additional info:

This bug was found in test run:


Comment 1 Oved Ourfali 2014-07-16 08:23:44 UTC
A rewrite of the REST API for the power management definition is on the way.
Will be available in 3.6.
Changing the target release properly.

Comment 2 Ori Liel 2015-04-08 07:22:03 UTC
The Power-Management refactoring for 3.6 was done, among other reasons, because the old entity structure was wrong. One bad thing about the old structure was that 'type' was associated directly with 'Power-Management'. Since two agents in the same Power-Management may have different types, this doesn't make sense. Updating 'type' of the Power-Management as describes in the bug description would result in updating the type of the first agent. Since this is wrong to begin with, I see no point maintaining backwards-compatibility to it.  

The new way to update agent type is: 
  PUT  ...api/hosts/xxx/fenceagnets/yyy     (xxx = host-id, yyy = fence-agent id)

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