Bug 806334

Summary: [REST API] no link to add a new key in the keys resource
Product: OKD Reporter: Andre Dietisheim <adietish>
Component: PodAssignee: Lili Nader <lnader>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: mfisher, mpatel, xcoulon
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-27 20:17:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Andre Dietisheim 2012-03-23 13:19:35 UTC
There's no link to add a new key in the keys resource:

curl -k -H "Accept: application/xml" --user "adietish:PASSWORD" https://openshift.redhat.com/broker/rest/user/keys/ -v


<response>
  <type>keys</type>
  <status>ok</status>
  <messages/>
  <data>
    <key>
      <type>ssh-rsa</type>
      <content>KEYCONTENT</content>
      <name>default</name>
      <links>
        <link>
          <rel>Get SSH key</rel>
          <href>/user/keys/default</href>
          <method>GET</method>
          <optional-params/>
          <required-params/>
        </link>
        <link>
          <rel>Update SSH key</rel>
          <href>/user/keys/default</href>
          <method>PUT</method>
          <optional-params/>
          <required-params>
            <param>
              <type>string</type>
              <name>type</name>
              <valid-options>
                <valid-option>ssh-rsa</valid-option>
                <valid-option>ssh-dss</valid-option>
              </valid-options>
              <description>Type of Key</description>
            </param>
            <param>
              <type>string</type>
              <name>content</name>
              <valid-options/>
              <description>The key portion of an rsa key (excluding ssh-rsa and comment)</description>
            </param>
          </required-params>
        </link>
        <link>
          <rel>Delete SSH key</rel>
          <href>/user/keys/default</href>
          <method>DELETE</method>
          <optional-params/>
          <required-params/>
        </link>
      </links>
    </key>
  </data>
  <version>1.0</version>
</response>

There is a link in the user resource though. But this looks like the wrong location to me.

Comment 1 Andre Dietisheim 2012-03-23 13:24:30 UTC
> 
> There is a link in the user resource though. But this looks like the wrong
> location to me.

 <user>
    <login>adietish</login>
    <links>
      <link>
        <rel>Get user information</rel>
        <href>/user</href>
        <method>GET</method>
        <optional-params/>
        <required-params/>
      </link>
      <link>
        <rel>Add new SSH key</rel>
        <href>/user/keys</href>
        <method>POST</method>
        <optional-params/>
        <required-params>
          <param>
            <type>string</type>
            <name>name</name>
            <valid-options/>
            <description>Name of the application</description>
          </param>
          <param>
            <type>string</type>
            <name>type</name>
            <valid-options>
              <valid-option>ssh-rsa</valid-option>
              <valid-option>ssh-dss</valid-option>
            </valid-options>
            <description>Type of Key</description>
          </param>
          <param>
            <type>string</type>
            <name>content</name>
            <valid-options/>
            <description>The key portion of an rsa key (excluding ssh-rsa and comment)</description>
          </param>
        </required-params>
      </link>

Comment 2 Lili Nader 2012-03-27 20:17:17 UTC
as mentioned above the link is under user resource.