Bug 1645890 - [REST] vnicprofiles point to "networks/[NET-ID]/vnicprofiles/" instead of: "/vnicprofiles/[VNIC-PROFILE-ID]"
Summary: [REST] vnicprofiles point to "networks/[NET-ID]/vnicprofiles/" instead of: "/...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.3.0
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ovirt-4.3.0
: 4.3.0
Assignee: Ori Liel
QA Contact: Michael Burman
URL:
Whiteboard: Automation, AutomationBlocker, Regres...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-04 17:49 UTC by Roni
Modified: 2019-02-13 07:48 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.3.0_alpha
Clone Of:
Environment:
Last Closed: 2019-02-13 07:48:03 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.3+


Attachments (Terms of Use)
vnic_profile REST API 4.3 vs 4.2 (284.39 KB, image/png)
2018-11-04 17:49 UTC, Roni
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 95259 0 master MERGED restapi: Redirect vnic-profiles link 2018-11-05 12:37:05 UTC

Description Roni 2018-11-04 17:49:48 UTC
Created attachment 1501402 [details]
vnic_profile REST API 4.3 vs 4.2

Description of problem:
The links under: "/ovirt-engine/api/vnicprofiles"

point to:
"/ovirt-engine/api/networks/[NETWORK-ID]/vnicprofiles/[VNIC-PROFILE-ID]"

instead of: 
"/ovirt-engine/api/vnicprofiles/[VNIC-PROFILE-ID]"
as it was at v4.2

Got error 405-"Method Not Allowed" while trying to modify (PUT) vnic_profile
through REST API

Version-Release number of selected component (if applicable):
4.3.0-0.0.master.20181101091940.git61310aa.el7

How reproducible:
100%

Steps to Reproduce:
1. Browse to: https://engine-fqdn:/ovirt-engine/api/vnicprofiles
2. 
3.


Actual results:
"/ovirt-engine/api/vnicprofiles/[VNIC-PROFILE-ID]"


Expected results:
"/ovirt-engine/api/networks/[NETWORK-ID]/vnicprofiles/[VNIC-PROFILE-ID]"


Additional info:
See attached: vnic_profile REST API 4.3 vs 4.2

Art logs:
2018-11-01 11:11:56,741 - MainThread - root - INFO - Prepare vnic profile object for create or update with {'custom_properties': 'clear', 'name': 'ovirtmgmt', 'data_center': 'golden_env_mixed'}
2018-11-01 11:11:56,741 - MainThread - vnicprofiles - DEBUG - PUT request content is --  url:/ovirt-engine/api/networks/55744e4e-f16e-46dd-a694-8442330d1900/vnicprofiles/973d994c-978a-43d1-b327-c383477dcc61 body:<vnic_profile>
    <name>ovirtmgmt</name>
    <custom_properties/>
</vnic_profile>
 
2018-11-01 11:11:56,742 - MainThread - vnicprofiles - INFO - Using Correlation-Id: vnicprofiles_update_f463a7c7-ca77-4dde
2018-11-01 11:11:56,759 - MainThread - core_api - DEBUG - Request PUT response time: 0.010
2018-11-01 11:11:56,759 - MainThread - vnicprofiles - DEBUG - Cleaning Correlation-Id: vnicprofiles_update_f463a7c7-ca77-4dde
2018-11-01 11:11:56,760 - MainThread - vnicprofiles - ERROR - Details was not found on body
2018-11-01 11:11:56,760 - MainThread - api_utils - ERROR - Failed to update element NOT as expected:
	Status: 405
	Reason: Method Not Allowed

2018-11-01 11:11:56,760 - MainThread - vnicprofiles - ERROR - Response code is not valid, expected is: [200, 201], actual is: 405 
2018-11-01 11:11:56,760 - MainThread - root - ERROR - Failed to update vnic profile with {'custom_properties': 'clear', 'data_center': 'golden_env_mixed', 'network': 'ovirtmgmt', 'name': 'ovirtmgmt'}

Comment 1 Michael Burman 2018-11-05 09:29:39 UTC
Hi Ori,

Can you please take a look at this one? this is blocking us from testing.

Comment 2 Ori Liel 2018-11-05 09:42:07 UTC
Sure, I know what this is about.

It results from a correct repair done to the repository of static data about the API structure, used for link-generation purposes. This data was perviously manually maintained, and thus contained many errors.

This patch:

  https://gerrit.ovirt.org/#/c/82294

made the repository 100% correct by replacing the human maintenance with automatic data mining. However in some cases, the result of the repository containing the correct data broke backwards compatibility, in places where particular implementations 'counted on' the repository being wrong. As such cases surface, they are handeled manually by a patch, as in: 

  https://gerrit.ovirt.org/#/c/94909

It's important to stress that not all cases were foreseeable at the time of submitting https://gerrit.ovirt.org/#/c/82294/, at least not without manual testing of every single endpoint in the API, something which was not feasible. 

I will submit a patch fixing this issue soon

Comment 3 Michael Burman 2018-11-22 10:51:48 UTC
Verified on - 4.3.0-0.2.master.20181121071050.gita8fcd23.el7

Comment 4 Sandro Bonazzola 2019-02-13 07:48:03 UTC
This bugzilla is included in oVirt 4.3.0 release, published on February 4th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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