Bug 1350228

Summary: Add affinity label to the VM or to the host does not return in response body entity
Product: [oVirt] ovirt-engine Reporter: Artyom <alukiano>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: medium Docs Contact:
Priority: high    
Version: 4.0.0CC: bugs, mgoldboi, mperina, rgolan
Target Milestone: ovirt-4.0.4Keywords: Triaged
Target Release: 4.0.4Flags: rule-engine: ovirt-4.0.z+
rule-engine: planning_ack+
rgolan: devel_ack+
pstehlik: testing_ack+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-26 12:31:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Artyom 2016-06-26 15:11:28 UTC
Description of problem:
Add affinity label to the VM or to the host does not return in response body entity.
It just return some information message:
<action>
<status>complete</status>
</action>

Version-Release number of selected component (if applicable):
rhevm-4.0.0.6-0.1.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create new affinity label
2. Add affinity label to the VM or to the host
POST action to api/vms/vm_id/affinitylabels:
<affinity_label id="affinity_label_id"/>
3.

Actual results:
<action>
<status>complete</status>
</action>

Expected results:
<affinity_label>
  ...
</affinity_label>

Additional info:
The same correct if I add VM or host under affinity label collection
POST action to api/affinitylabels/vm_id/vms
<vm id="affinity_label_id"/>

Comment 1 Red Hat Bugzilla Rules Engine 2016-06-27 06:27:39 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Artyom 2016-07-17 12:07:53 UTC
Checked on rhevm-4.0.2-0.2.rc1.el7ev.noarch

1) Add affinity label to VM or host works correctly.

2) Add host or VM to affinity label
POST to
api/affinitylabels/84f70042-d00c-4b9f-be5b-c5f5d2ad9add/vms

body:
<vm id="cbe701c0-f395-4b90-a67f-a461057f4638"/>

still, response is only:
<action>
<status>complete</status>
</action>

Comment 3 Red Hat Bugzilla Rules Engine 2016-07-17 12:07:58 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 4 Artyom 2016-07-24 14:19:49 UTC
Checked on rhevm-4.0.2-0.1.rc.el7ev.noarch

Add host or VM to affinity label
POST to
api/affinitylabels/84f70042-d00c-4b9f-be5b-c5f5d2ad9add/vms

body:
<vm id="cbe701c0-f395-4b90-a67f-a461057f4638"/>

still, response is only:
<action>
<status>complete</status>
</action>

Comment 5 Red Hat Bugzilla Rules Engine 2016-07-24 14:19:54 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 6 Juan Hernández 2016-07-26 10:40:31 UTC
The affected resources have been changed so they will return the added virtual machine (or host) instead of an action, so a request like this:

  POST /ovirt-engine/api/affinitylabels/{label:id}/vms
  <vm id="{vm:id}"/>

Will return the following response:

  HTTP/1.1 200 OK
  <vm id="{vm:id}" href="/ovirt-engine/api/vms/{vm:id}"/>

Comment 7 Artyom 2016-09-05 12:00:15 UTC
Verified on ovirt-engine-restapi-4.0.4-0.1.el7ev.noarch

Comment 8 Artyom 2016-09-05 12:00:16 UTC
Verified on ovirt-engine-restapi-4.0.4-0.1.el7ev.noarch