<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 255); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hello Asha,</div>
<div><br>
</div>
<div>I missed this later email, sorry.</div>
<div><br>
</div>
<div>The content type on the PUT call determines the type of the secret (the first POST call only creates the metadata for the secret).</div>
<div><br>
</div>
<div>This older wiki page might help clarify things: <a href="https://github.com/cloudkeep/barbican/wiki/Application-Programming-Interface#two-step-binary-secret-createretrieve">https://github.com/cloudkeep/barbican/wiki/Application-Programming-Interface#two-step-binary-secret-createretrieve</a></div>
<div><br>
</div>
<div>Thanks,</div>
<div>John</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Asha Seshagiri <<a href="mailto:asha.seshagiri@gmail.com">asha.seshagiri@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>openstack-dev <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span>Friday, March 20, 2015 at 3:04 PM<br>
<span style="font-weight:bold">To: </span>openstack-dev <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [openstack-dev] Barbican : Unable to send PUT request to store the secret<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>Hi All ,</div>
<div><br>
</div>
<div>Now the command for put request  has been successful .the content type for the header needs to be text/plain.</div>
<div>I thought that the  datatype for the data parameters would determine the content type of the header.</div>
<div><br>
</div>
<div>For ex : In this case the data is passed in the following format   <b>'{"secret": {"payload": "secretput", "payload_content_type": "text/plain }}' which is the JSON type .</b></div>
<div> </div>
<div>curl -X PUT -H 'content-type:text/plain' -H 'X-Project-Id: 12345' -d <b>'{"secret": {"payload": "secretput", "payload_content_type": "text/plain }}'
</b><a href="http://localhost:9311/v1/secrets/89d424c3-f4c1-4822-8bd7-7691f40f7ba3">http://localhost:9311/v1/secrets/89d424c3-f4c1-4822-8bd7-7691f40f7ba3</a></div>
<div><br>
</div>
<div>Could anyone provide the clarity on content type of the header</div>
<div><br>
</div>
<div>Thanks and Regards,</div>
<div>Asha Seshagiri</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Mar 20, 2015 at 2:05 PM, Asha Seshagiri <span dir="ltr">
<<a href="mailto:asha.seshagiri@gmail.com" target="_blank">asha.seshagiri@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>Hi All ,</div>
<div><br>
</div>
<div>I am unable to send the PUT request using the CURL command for storing the secret .</div>
<div><br>
</div>
<div><br>
</div>
<div>root@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"}}'
<a href="http://localhost:9311/v1/secrets" target="_blank">http://localhost:9311/v1/secrets</a></div>
<div>
<div>{"secret_ref": "<a href="http://localhost:9311/v1/secrets/84aaac35-daa9-4ffb-b03e-18596729705d" target="_blank">http://localhost:9311/v1/secrets/84aaac35-daa9-4ffb-b03e-18596729705d</a>"}</div>
</div>
<div><br>
</div>
<div>
<div>curl -X PUT -H 'content-type:application/json' -H 'X-Project-Id: 12345' -d '{"secret": {"payload": "secretput", "payload_content_type": "text/plain" }}'
<a href="http://localhost:9311/v1/secrets" target="_blank">http://localhost:9311/v1/secrets</a></div>
<div><b>{"code": 405, "description": "", "title": "Method Not Allowed"}</b></div>
</div>
<div><br>
</div>
<div>It would be great if some one could help me .</div>
<div>Thanks in advance.</div>
<span class="HOEnZb"><font color="#888888">
<div><br>
</div>
-- <br>
<div>
<div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div>
</div>
</font></span></div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div>
</div>
</div>
</div>
</div>
</div>
</span>
</body>
</html>