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

Bug 1324935

Summary: [REST API] Missing href field for sshpublickey
Product: [oVirt] ovirt-engine Reporter: Ilanit Stein <istein>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Ilanit Stein <istein>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.5.1CC: bmcclain, bugs, fromani, mavital, oliel, oourfali, pstehlik, sbonazzo
Target Milestone: ovirt-3.6.6Keywords: ZStream
Target Release: 3.6.6Flags: rule-engine: ovirt-3.6.z+
bmcclain: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-30 10:53:10 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:

Description Ilanit Stein 2016-04-07 15:48:04 UTC
Description of problem:

REST API call for ssh_public_key element, under sshpublickeys collection,
brings object that is missing href.

Here's an example:
=================
GET from 
URL:  http://<engine fqdn>/ovirt-engine/api/users/0000001a-001a-001a-001a-000000000375/sshpublickeys

RESPONSE:
<ssh_public_keys>
<ssh_public_key id="a1fff9ba-9a59-4679-9eeb-607d8f7d3390">
<content>
ssh-rsa . . .
</content>
<user href= "/ovirt-engine/api/users/0000001a-001a-001a-001a-000000000375" id="0000001a-001a-001a-001a-000000000375"/>
</ssh_public_key>
</ssh_public_keys>

Version-Release number of selected component (if applicable):
rhevm 3.6.5.1-0.1.el6

How reproducible:
100%

Expected results:
sshpublickey object should have href field.

Additional info:
* This missing href, blocks the option of doing Update for a user ssh public key. From QE automatic test, and thus actually blocks testing of VM serial console.
* Is it a problem that the name of the collection in the url is sshpublickeys
(no underscore), while in the response the name of the collection is: ssh_public_keys.

Comment 1 Juan Hernández 2016-04-07 17:35:07 UTC
The missing link as a bug, and we will fix it.

The different names in URL segments and in XML tags aren't a bug, and can't be fixed. The URL segment indicates the name of a relationship, in this case the relationship between the user and her SSH public keys. The XML tags are names of types of objects. For example, imagine that we want to have two relationships between users and SSH keys: one for the "current" and another one for "archived" keys. In that case the URL segments would be "currentsshpublickeys" and "archivedsshpublickeys", but the XML tag would be the same in both cases. This means that the QE testing framework needs to be prepared to deal with these differences.

Comment 2 Juan Hernández 2016-04-14 10:30:45 UTC
Oved, can you set the 3.6.z flag in this bug?

Comment 3 Oved Ourfali 2016-04-14 10:38:00 UTC
For upstream bugs, either remove the 4.0, or clone manually if needed.
That's what I understood in the last build meeting.

Sandro - am I correct?

Comment 4 Sandro Bonazzola 2016-04-18 12:20:21 UTC
(In reply to Oved Ourfali from comment #3)
> For upstream bugs, either remove the 4.0, or clone manually if needed.
> That's what I understood in the last build meeting.
> 
> Sandro - am I correct?

Correct

Comment 5 Ilanit Stein 2016-05-09 06:13:54 UTC
Verified on rhevm-3.6.6.2-0.1

Now the href appear for ssh_public_key item, under ssh_public_keys



GET for 
https://<engine ip address>:443/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/sshpublickeys

RESPONSE:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ssh_public_keys>
    <ssh_public_key href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc/sshpublickeys/1d8de784-e776-41f5-b537-cb3a6871c8ff" id="1d8de784-e776-41f5-b537-cb3a6871c8ff">
        <content>ssh-rsa . . . </content>
        <user href="/ovirt-engine/api/users/fdfc627c-d875-11e0-90f0-83df133b58cc" id="fdfc627c-d875-11e0-90f0-83df133b58cc"/>
    </ssh_public_key>
</ssh_public_keys>