How to delete API Keys through HTTP request.

20 views
Skip to first unread message

Amol Shende

unread,
Oct 19, 2015, 9:36:40 AM10/19/15
to Rancher
Hi,
I have created API keys through HTTP request. But , Now I am unable to delete API keys through HTTP request. So, can anyone help me? 
 
For creating API keys I have used following request

HTTP/1.1 POST /v1/projects/1a5/apikeys
Host: rancher_ip:8080
Accept: application/json
Content-Type: application/json
Content-Length: 32

{
"description": "abc",
"name": "abc",
}

Darren S

unread,
Oct 19, 2015, 10:46:26 AM10/19/15
to Rancher
Hey, you should check our forums at http://forums.rancher.com, we have moved all conversations there.

For your issue, when you do "POST /v1/projects/1a5/apikeys" in the response it give you back an id.  For example

{
  "id": "1c2",
  "publicValue": "...."
}

Just take that ID and first "deactivate" the key.  This will make the key not valid.  So "POST /v1/projects/1a5/apkeys/1c2?action=deactivate".  Then once the apikey is inactive you can delete DELETE /v1/projects/1a5/apkeys/1c2"

Darren

Amol Shende

unread,
Oct 20, 2015, 7:43:53 AM10/20/15
to Rancher
Thanks Darren,
Now, using GET /v1/projects/1a5/apkeys/key_id  , I am fetching key info. In that key info It gives "publicValue" of key but In case of "secretValue" it gives "null".
So, Can I get "secretValue" for the key using GET request? 
Reply all
Reply to author
Forward
0 new messages