forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Li, Qiao <qiaoli@huawei.com> Co-committed-by: Li, Qiao <qiaoli@huawei.com>
177 lines
15 KiB
HTML
177 lines
15 KiB
HTML
<a name="waf_02_0020"></a><a name="waf_02_0020"></a>
|
|
|
|
<h1 class="topictitle1">Uploading a Certificate</h1>
|
|
<div id="body40087950"><div class="section" id="waf_02_0020__section5909008"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0020__p25898556">This API is used to upload a certificate.</p>
|
|
</div>
|
|
<div class="section" id="waf_02_0020__section53181073"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0020__ul17408302"><li id="waf_02_0020__li22456997">URI format<p id="waf_02_0020__p786381"><a name="waf_02_0020__li22456997"></a><a name="li22456997"></a>POST /v1/{project_id}/waf/certificate</p>
|
|
</li><li id="waf_02_0020__li1631262617234">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0020__table6333726152318" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0020__row16331202682317"><th align="left" class="cellrowborder" valign="top" width="25.507449255074494%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="waf_02_0020__p73311326162320"><strong id="waf_02_0020__b43013176296">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="waf_02_0020__p1333162616234"><strong id="waf_02_0020__b18410718172915">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="waf_02_0020__p18331102622313"><strong id="waf_02_0020__b736311193291">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="waf_02_0020__p1133116269234"><strong id="waf_02_0020__b3941131915297">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="waf_02_0020__row173335264239"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0020__p13311626142316">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0020__p1033312692319">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0020__p933392672311">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0020__p73336265234">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="waf_02_0020__section8867609"><h4 class="sectiontitle">Request</h4><p id="waf_02_0020__p208791751123316">Request parameters</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0020__table01910549582" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0020__row13191654175813"><th align="left" class="cellrowborder" valign="top" width="19.88%" id="mcps1.3.3.3.2.5.1.1"><p id="waf_02_0020__p877688145917"><strong id="waf_02_0020__b8504827182911">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.91%" id="mcps1.3.3.3.2.5.1.2"><p id="waf_02_0020__p277717819595"><strong id="waf_02_0020__b1897795236">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.63%" id="mcps1.3.3.3.2.5.1.3"><p id="waf_02_0020__p147799875915"><strong id="waf_02_0020__b2129247592">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="48.58%" id="mcps1.3.3.3.2.5.1.4"><p id="waf_02_0020__p87821486598"><strong id="waf_02_0020__b18738829172914">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="waf_02_0020__row17191175417588"><td class="cellrowborder" valign="top" width="19.88%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0020__p1478588115915">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.91%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0020__p1679028155913">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.63%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0020__p167911184598">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.58%" headers="mcps1.3.3.3.2.5.1.4 "><p id="waf_02_0020__p157946819593">Specifies the certificate name. The maximum length is 256 characters. Only digits, letters, underscores (_), and hyphens (-) are allowed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="waf_02_0020__row9191454185813"><td class="cellrowborder" valign="top" width="19.88%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0020__p67968816592">content</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.91%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0020__p57981813597">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.63%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0020__p3800178155915">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.58%" headers="mcps1.3.3.3.2.5.1.4 "><p id="waf_02_0020__p157351532185415">Specifies the certificate content.</p>
|
|
<div class="note" id="waf_02_0020__note133525375548"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="waf_02_0020__ul642384215411"><li id="waf_02_0020__li14241942125416">The following is an example of the obtained certificate content:<pre class="codeblock" id="waf_02_0020__codeblock15081228181110">-----BEGIN CERTIFICATE-----
|
|
MIIDezCCAmOgAwIBAgIJAMJcdOLsrN3iMA0GCSqGSIb3DQEBCwUAMFQxCzAJBgNV
|
|
...
|
|
8qh1Vpk2FXoadOVze2fQFLBkkB7LPExj8Nrf76CJEA==
|
|
-----END CERTIFICATE-----</pre>
|
|
</li><li id="waf_02_0020__li172065181553">Line endings are replaced with <strong id="waf_02_0020__b999516493332">\n</strong> by default before uploading the certificate content. For example:<p id="waf_02_0020__p1352649185612">-----BEGIN CERTIFICATE-----<span class="parmvalue" id="waf_02_0020__parmvalue825731415416"><b>\n</b></span>MIIDezCCAmOgAwIBAgIJAMJcdOLsrN3iMA0GCSqGSIb3DQEBCwUAMFQxCzAJBgNV<span class="parmvalue" id="waf_02_0020__parmvalue8677208416"><b>\n</b></span>...<span class="parmvalue" id="waf_02_0020__parmvalue078752311412"><b>\n</b></span>8qh1Vpk2FXoadOVze2fQFLBkkB7LPExj8Nrf76CJEA==<span class="parmvalue" id="waf_02_0020__parmvalue9427182815410"><b>\n</b></span>-----END CERTIFICATE-----</p>
|
|
</li></ul>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="waf_02_0020__row171916540581"><td class="cellrowborder" valign="top" width="19.88%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0020__p180512812596">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.91%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0020__p78057895916">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.63%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0020__p580798175916">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.58%" headers="mcps1.3.3.3.2.5.1.4 "><p id="waf_02_0020__p778819469461">Specifies the private key.</p>
|
|
<div class="note" id="waf_02_0020__note7377951114614"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="waf_02_0020__ul640212312508"><li id="waf_02_0020__li340210312504">The following is an example of the obtained private key:<pre class="codeblock" id="waf_02_0020__codeblock4689442101114">-----BEGIN RSA PRIVATE KEY-----
|
|
MIIEowIBAAKCAQEAsj2QPAwXYcPDH0mvf6Jbej6RGgYlb4EFMS85BjKrKNPOTqZf
|
|
...
|
|
4j0RY9DeUgSLdy625BBmew2it9l/NynIScG4Ow6w8Bu4iBANGv94
|
|
-----END RSA PRIVATE KEY-----</pre>
|
|
</li><li id="waf_02_0020__li94021639501">Line endings are replaced with <strong id="waf_02_0020__b1843619229371">\n</strong> by default before uploading the private key. For example:<p id="waf_02_0020__p55316421506">----BEGIN RSA PRIVATE KEY----<span class="parmvalue" id="waf_02_0020__parmvalue127084374214"><b>\n</b></span>MIIEowIBAAKCAQEAsj2QPAwXYcPDH0mvf6Jbej6RGgYlb4EFMS85BjKrKNPOTqZf<span class="parmvalue" id="waf_02_0020__parmvalue155198451217"><b>\n</b></span>...<span class="parmvalue" id="waf_02_0020__parmvalue142350521923"><b>\n</b></span>4j0RY9DeUgSLdy625BBmew2it9l/NynIScG4Ow6w8Bu4iBANGv94<span class="parmvalue" id="waf_02_0020__parmvalue12921256828"><b>\n</b></span>-----END RSA PRIVATE KEY-----</p>
|
|
</li></ul>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="waf_02_0020__section12699617"><h4 class="sectiontitle">Response</h4><div class="p" id="waf_02_0020__p19698416173413">Response parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0020__table58327572" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0020__row12075850"><th align="left" class="cellrowborder" valign="top" width="42.85571442855714%" id="mcps1.3.4.2.1.2.4.1.1"><p id="waf_02_0020__p38619773"><strong id="waf_02_0020__b169731844183116">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.4.2.1.2.4.1.2"><p id="waf_02_0020__p41193880"><strong id="waf_02_0020__b1167946163113">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.4.2.1.2.4.1.3"><p id="waf_02_0020__p48369988"><strong id="waf_02_0020__b3818124620312">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="waf_02_0020__row32676712"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0020__p29567983">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0020__p46196443">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0020__p50924436">Specifies the certificate ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="waf_02_0020__row55666745"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0020__p12712463">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0020__p23076582">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0020__p57263845">Specifies the certificate name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="waf_02_0020__row944795925117"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0020__p466545510448">expireTime</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0020__p11665125516444">Long</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0020__p17665655174419">Specifies the time when the certificate expires.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="waf_02_0020__row64272916384"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0020__p124275910384">timestamp</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0020__p1342716963812">Long</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0020__p2042739183818">Specifies the time when the certificate is uploaded.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="waf_02_0020__section15246722163414"><h4 class="sectiontitle">Examples</h4><p id="waf_02_0020__p1446591883211">A certificate named <strong id="waf_02_0020__b1722114221426">cert_a</strong> is used as an example.</p>
|
|
<ul id="waf_02_0020__ul12286522153418"><li id="waf_02_0020__li1328682212345">Request example<pre class="screen" id="waf_02_0020__screen15286522183414">{
|
|
"name": "cert_a",
|
|
"content": "-----BEGIN CERTIFICATE-----<strong id="waf_02_0020__b55016246620">\n</strong>MIIDezCCAmOgAwIBAgIJAMJcdOLsrN3iMA0GCSqGSIb3DQEBCwUAMFQxCzAJBgNV<strong id="waf_02_0020__b138223351665">\n</strong>...<strong id="waf_02_0020__b118061541967">\n</strong>8qh1Vpk2FXoadOVze2fQFLBkkB7LPExj8Nrf76CJEA==<strong id="waf_02_0020__b66941047160">\n</strong>-----END CERTIFICATE-----",
|
|
"key": "----BEGIN RSA PRIVATE KEY----<strong id="waf_02_0020__b199328541065">\n</strong>MIIEowIBAAKCAQEAsj2QPAwXYcPDH0mvf6Jbej6RGgYlb4EFMS85BjKrKNPOTqZf<strong id="waf_02_0020__b561219012715">\n</strong>...<strong id="waf_02_0020__b89390519720">\n</strong>4j0RY9DeUgSLdy625BBmew2it9l/NynIScG4Ow6w8Bu4iBANGv94<strong id="waf_02_0020__b3363101218719">\n</strong>-----END RSA PRIVATE KEY-----"
|
|
}</pre>
|
|
</li></ul>
|
|
<ul id="waf_02_0020__ul42867227348"><li id="waf_02_0020__li1286182263420">Response example<pre class="screen" id="waf_02_0020__screen11286112215344">{
|
|
"id": "388a7789d55b41d1918b3088a8f1e7f3",
|
|
"name": "cert_b",
|
|
"expireTime": 1565467166765,
|
|
"timestamp": 1545467166765
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="waf_02_0020__section47187690"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0020__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0020__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 4</a> describes the normal status code returned by the API.
|
|
<div class="tablenoborder"><a name="waf_02_0020__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0020__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status code</caption><thead align="left"><tr id="waf_02_0020__waf_02_0012_r3d6e2f205c444705bdbb9daaac74e575"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.6.2.2.2.4.1.1"><p id="waf_02_0020__waf_02_0012_af3c4073076f24eca88d94e3fa1effdc6">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.41%" id="mcps1.3.6.2.2.2.4.1.2"><p id="waf_02_0020__waf_02_0012_en-us_topic_0144911667_p4531342288">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="58.589999999999996%" id="mcps1.3.6.2.2.2.4.1.3"><p id="waf_02_0020__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="waf_02_0020__waf_02_0012_rc7b2adc390904a1ba79e303017797786"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="waf_02_0020__waf_02_0012_a93f3895d44bb4226934cc626ac50e37b">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.41%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="waf_02_0020__waf_02_0012_en-us_topic_0144911667_p7538425819">OK</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="waf_02_0020__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p id="waf_02_0020__waf_02_0012_en-us_topic_0144911667_p482819399522">For details about error status codes, see <a href="waf_02_0085.html">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="waf_02_0018.html">Certificate Management</a></div>
|
|
</div>
|
|
</div>
|
|
|