Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1645890

Summary: [REST] vnicprofiles point to "networks/[NET-ID]/vnicprofiles/" instead of: "/vnicprofiles/[VNIC-PROFILE-ID]"
Product: [oVirt] ovirt-engine Reporter: Roni <reliezer>
Component: BLL.NetworkAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: bugs, mperina, oliel
Target Milestone: ovirt-4.3.0Flags: rule-engine: ovirt-4.3+
Target Release: 4.3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: Automation, AutomationBlocker, Regression
Fixed In Version: ovirt-engine-4.3.0_alpha Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-13 07:48:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
vnic_profile REST API 4.3 vs 4.2 none

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.