[openstack-dev] [barbican] Barbican : Unable to send PUT request to store the secret

John Wood john.wood at RACKSPACE.COM
Sat Mar 21 03:38:23 UTC 2015


Hello Asha,

I missed this later email, sorry.

The content type on the PUT call determines the type of the secret (the first POST call only creates the metadata for the secret).

This older wiki page might help clarify things: https://github.com/cloudkeep/barbican/wiki/Application-Programming-Interface#two-step-binary-secret-createretrieve

Thanks,
John

From: Asha Seshagiri <asha.seshagiri at gmail.com<mailto:asha.seshagiri at gmail.com>>
Reply-To: openstack-dev <openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>>
Date: Friday, March 20, 2015 at 3:04 PM
To: openstack-dev <openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>>
Subject: Re: [openstack-dev] Barbican : Unable to send PUT request to store the secret

Hi All ,

Now the command for put request  has been successful .the content type for the header needs to be text/plain.
I thought that the  datatype for the data parameters would determine the content type of the header.

For ex : In this case the data is passed in the following format   '{"secret": {"payload": "secretput", "payload_content_type": "text/plain }}' which is the JSON type .

curl -X PUT -H 'content-type:text/plain' -H 'X-Project-Id: 12345' -d '{"secret": {"payload": "secretput", "payload_content_type": "text/plain }}' http://localhost:9311/v1/secrets/89d424c3-f4c1-4822-8bd7-7691f40f7ba3

Could anyone provide the clarity on content type of the header

Thanks and Regards,
Asha Seshagiri

On Fri, Mar 20, 2015 at 2:05 PM, Asha Seshagiri <asha.seshagiri at gmail.com<mailto:asha.seshagiri at gmail.com>> wrote:
Hi All ,

I am unable to send the PUT request using the CURL command for storing the secret .


root at barbican:~# curl -X POST -H 'content-type:application/json' -H 'X-Project-Id: 12345' -d '{"secret": {"name": "secretname", "algorithm": "aes", "bit_length"                                  : 256, "mode": "cbc"}}' http://localhost:9311/v1/secrets
{"secret_ref": "http://localhost:9311/v1/secrets/84aaac35-daa9-4ffb-b03e-18596729705d"}

curl -X PUT -H 'content-type:application/json' -H 'X-Project-Id: 12345' -d '{"secret": {"payload": "secretput", "payload_content_type": "text/plain" }}' http://localhost:9311/v1/secrets
{"code": 405, "description": "", "title": "Method Not Allowed"}

It would be great if some one could help me .
Thanks in advance.

--
Thanks and Regards,
Asha Seshagiri



--
Thanks and Regards,
Asha Seshagiri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150321/0839ed04/attachment.html>


More information about the OpenStack-dev mailing list