Bug 1324935 - [REST API] Missing href field for sshpublickey
Summary: [REST API] Missing href field for sshpublickey
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 3.6.5.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-3.6.6
: 3.6.6
Assignee: Juan Hernández
QA Contact: Ilanit Stein
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-07 15:48 UTC by Ilanit Stein
Modified: 2016-05-30 10:53 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-30 10:53:10 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-3.6.z+
bmcclain: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 55842 0 master MERGED restapi: Add links to SSH public keys 2016-04-08 07:05:46 UTC
oVirt gerrit 55853 0 ovirt-engine-3.6 MERGED restapi: Add links to SSH public keys 2016-04-18 12:46:23 UTC

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>


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