forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com> Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
171 lines
17 KiB
HTML
171 lines
17 KiB
HTML
<a name="EN-US_TOPIC_0000002374101041"></a><a name="EN-US_TOPIC_0000002374101041"></a>
|
|
|
|
<h1 class="topictitle1">Querying SSH Key Pairs (Native OpenStack API)</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section17769131"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p18206352154151">This API is used to query SSH key pairs.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section25186711103718"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p16432194535320">Pagination query is not supported.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section40393097103718"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p6210004103718">GET /v2.1/{project_id}/os-keypairs</p>
|
|
<p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p1872113815415"><a href="#EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table875418115417">Table 1</a> lists the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table875418115417"></a><a name="en-us_topic_0060384658_table875418115417"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table875418115417" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row20751518135416"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.1"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p67050730103718">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.2"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p62400032103718">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.3"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p21237868103718">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row675161812542"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p23650911103718">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p36675672103718">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p17939461103718">Specifies the project ID.</p>
|
|
<p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p9141450142010">For how to obtain the project ID, see <a href="https://docs.otc.t-systems.com/en-us/api/apiug/apig-en-api-180328009.html" target="_blank" rel="noopener noreferrer">Obtaining Required Information</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section43810255103718"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p1950919987">None</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section9537113918233"><h4 class="sectiontitle">Example Request</h4><div class="p" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p872116176298">Querying SSH key pairs in a project (ID: bbf1946d374b44a0a2a95533562ba954)<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_screen98661722155511"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">GET</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/os-keypairs</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section60965769103718"><h4 class="sectiontitle">Response Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table27586210103718" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row41984926103718"><th align="left" class="cellrowborder" valign="top" width="22.48224822482248%" id="mcps1.3.6.2.1.4.1.1"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p19987085">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.722872287228725%" id="mcps1.3.6.2.1.4.1.2"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p4546697">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="48.7948794879488%" id="mcps1.3.6.2.1.4.1.3"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p32738149">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row30149674103718"><td class="cellrowborder" valign="top" width="22.48224822482248%" headers="mcps1.3.6.2.1.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p26204567103718">keypairs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.722872287228725%" headers="mcps1.3.6.2.1.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p42195172103718">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.7948794879488%" headers="mcps1.3.6.2.1.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p62365753103718">Specifies key pairs. For details, see <a href="#EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table31933500103718">Table 2</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table31933500103718"></a><a name="en-us_topic_0060384658_table31933500103718"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table31933500103718" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_b1726205353915">keypairs</strong> data structure</caption><thead align="left"><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row13327014103718"><th align="left" class="cellrowborder" valign="top" width="22.509999999999998%" id="mcps1.3.6.3.2.4.1.1"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p898483610238">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.77%" id="mcps1.3.6.3.2.4.1.2"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p398620365236">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="48.72%" id="mcps1.3.6.3.2.4.1.3"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p69881436202319">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row65555086103718"><td class="cellrowborder" valign="top" width="22.509999999999998%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p8361735103718">keypair</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.77%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p6211933103718">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.72%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p33404535103718">Specifies details about a key pair. For details, see <a href="#EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table58497453103718">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table58497453103718"></a><a name="en-us_topic_0060384658_table58497453103718"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_table58497453103718" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_b13995185818390">keypair</strong> data structure</caption><thead align="left"><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row32349076103718"><th align="left" class="cellrowborder" valign="top" width="22.830000000000002%" id="mcps1.3.6.4.2.4.1.1"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p97199488231">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.89%" id="mcps1.3.6.4.2.4.1.2"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p20720548142312">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="48.28%" id="mcps1.3.6.4.2.4.1.3"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p14724548132319">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row45087230103718"><td class="cellrowborder" valign="top" width="22.830000000000002%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p28187038103718">fingerprint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.89%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p1448759103718">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.28%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p50240624103718">Specifies fingerprint information about the key pair.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row49512432103718"><td class="cellrowborder" valign="top" width="22.830000000000002%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p51084028103718">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.89%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p44165629103718">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.28%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p20646235103718">Specifies the key pair name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row5652164133420"><td class="cellrowborder" valign="top" width="22.830000000000002%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p565314113349">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.89%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p865354117348">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.28%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p765344153418">Specifies the key type, which is <strong id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_b84235270619443">ssh</strong> by default.</p>
|
|
<p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p2049715618353">This field is supported in microversions later than 2.2.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_row51598392103718"><td class="cellrowborder" valign="top" width="22.830000000000002%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p18720236103718">public_key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.89%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p39944111103718">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48.28%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_p14247596103718">Specifies information about the public key in the key pair.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section1979495118232"><h4 class="sectiontitle">Example Response</h4><div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_screen4690257120289"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span>
|
|
<span class="normal">11</span>
|
|
<span class="normal">12</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"keypairs"</span><span class="p">:</span><span class="w"> </span><span class="o">[</span>
|
|
<span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"keypair"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"fingerprint"</span><span class="p">:</span><span class="w"> </span><span class="s">"15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"name"</span><span class="p">:</span><span class="w"> </span><span class="s">"keypair-test"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"type"</span><span class="p">:</span><span class="w"> </span><span class="s">"ssh"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"public_key"</span><span class="p">:</span><span class="w"> </span><span class="s">"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated-by-Nova"</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="w"> </span><span class="o">]</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section7610951"><h4 class="sectiontitle">Returned Values</h4><div class="p" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p193201622141412">Normal values
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_table753804619176" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_row10735134615172"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.8.2.1.1.3.1.1"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p19735204616177">Returned Values</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.8.2.1.1.3.1.2"><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p207355465176">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_row1473514621713"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.8.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p13735144611178">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.8.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p207351246161711">The request has been successfully processed.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p47633965">For details about other returned values, see <a href="en-us_topic_0053158690.html">Status Codes</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_section14752650154917"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0000002374101041__en-us_topic_0060384658_en-us_topic_0106040941_p10243161417491">See <a href="en-us_topic_0107541808.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000002340063044.html">BMS SSH Key Management (Native OpenStack APIs)</a></div>
|
|
</div>
|
|
</div>
|
|
|