Bug 806334 - [REST API] no link to add a new key in the keys resource
[REST API] no link to add a new key in the keys resource
Status: CLOSED NOTABUG
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Lili Nader
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-23 09:19 EDT by Andre Dietisheim
Modified: 2015-05-14 21:49 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-27 16:17:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andre Dietisheim 2012-03-23 09:19:35 EDT
There's no link to add a new key in the keys resource:

curl -k -H "Accept: application/xml" --user "adietish@redhat.com: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 09:24:30 EDT
> 
> There is a link in the user resource though. But this looks like the wrong
> location to me.

 <user>
    <login>adietish@redhat.com</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 16:17:17 EDT
as mentioned above the link is under user resource.

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