Bug 806334 - [REST API] no link to add a new key in the keys resource
Summary: [REST API] no link to add a new key in the keys resource
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Lili Nader
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-23 13:19 UTC by Andre Dietisheim
Modified: 2015-05-15 01:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-27 20:17:17 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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