2016-04-12 09:03:46 -04:00
|
|
|
.. -*- rst -*-
|
|
|
|
|
|
|
|
=====================
|
|
|
|
Keypairs (keypairs)
|
|
|
|
=====================
|
|
|
|
|
|
|
|
Generates, imports, and deletes SSH keys.
|
|
|
|
|
|
|
|
List Keypairs
|
|
|
|
=============
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-keypairs
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Lists keypairs that are associated with the account.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-07-07 17:54:18 +00:00
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- user_id: keypair_user
|
2016-07-06 15:02:11 +03:00
|
|
|
- limit: keypair_limit
|
|
|
|
- marker: keypair_marker
|
2016-07-07 17:54:18 +00:00
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- keypairs: keypairs
|
2017-01-16 18:42:21 +09:00
|
|
|
- keypair: keypair
|
2016-06-03 09:50:43 -04:00
|
|
|
- name: keypair_name
|
|
|
|
- public_key: keypair_public_key
|
|
|
|
- fingerprint: keypair_fingerprint
|
|
|
|
- type: keypair_type
|
2016-09-09 10:30:14 +08:00
|
|
|
- keypairs_links: keypair_links
|
2016-06-03 09:50:43 -04:00
|
|
|
|
2017-01-03 11:58:53 -06:00
|
|
|
**Example List Keypairs (v2.35): JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2020-03-06 16:56:51 +00:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.35/keypairs-list-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
2022-07-08 17:23:01 +02:00
|
|
|
Import (or create) Keypair
|
|
|
|
==========================
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: POST /os-keypairs
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2022-07-08 17:23:01 +02:00
|
|
|
Imports (or generates) a keypair.
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
Generating a keypair is no longer possible starting from version 2.92.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
Normal response codes: 200, 201
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The success status code was changed from 200 to 201 in version 2.2
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403), conflict(409)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
- keypair: keypair
|
2022-07-08 17:23:01 +02:00
|
|
|
- name: keypair_name_in
|
2016-06-03 09:50:43 -04:00
|
|
|
- public_key: keypair_public_key_in
|
|
|
|
- type: keypair_type_in
|
|
|
|
- user_id: keypair_userid_in
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2017-01-16 18:42:21 +09:00
|
|
|
**Example Create Or Import Keypair (v2.10): JSON request**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2020-03-06 16:56:51 +00:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.10/keypairs-import-post-req.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
2022-07-08 17:23:01 +02:00
|
|
|
**Example Import Keypair (v2.92): JSON request**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.92/keypairs-import-post-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- keypair: keypair
|
|
|
|
- name: keypair_name
|
|
|
|
- public_key: keypair_public_key
|
|
|
|
- fingerprint: keypair_fingerprint
|
|
|
|
- user_id: keypair_userid
|
2017-01-16 18:42:21 +09:00
|
|
|
- private_key: keypair_private_key
|
|
|
|
- type: keypair_type
|
2016-06-03 09:50:43 -04:00
|
|
|
|
2017-01-16 18:42:21 +09:00
|
|
|
**Example Create Or Import Keypair (v2.10): JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2020-03-06 16:56:51 +00:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.10/keypairs-import-post-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
2022-07-08 17:23:01 +02:00
|
|
|
**Example Import Keypair (v2.92): JSON response**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.92/keypairs-import-post-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Show Keypair Details
|
|
|
|
====================
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-keypairs/{keypair_name}
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Shows details for a keypair that is associated with the account.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Normal response codes: 200
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
- keypair_name: keypair_name_path
|
2017-01-16 18:42:21 +09:00
|
|
|
- user_id: keypair_user
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- keypair: keypair
|
2017-01-16 18:42:21 +09:00
|
|
|
- created_at: created
|
|
|
|
- deleted: keypair_deleted
|
|
|
|
- deleted_at: keypair_updated_deleted_at
|
|
|
|
- fingerprint: keypair_fingerprint
|
|
|
|
- id: keypair_id
|
2016-06-03 09:50:43 -04:00
|
|
|
- name: keypair_name
|
|
|
|
- public_key: keypair_public_key
|
2017-01-16 18:42:21 +09:00
|
|
|
- updated_at: keypair_updated_deleted_at
|
2016-06-03 09:50:43 -04:00
|
|
|
- user_id: keypair_userid
|
2017-01-16 18:42:21 +09:00
|
|
|
- type: keypair_type
|
2016-06-03 09:50:43 -04:00
|
|
|
|
2017-01-16 18:42:21 +09:00
|
|
|
**Example Show Keypair Details (v2.10): JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2020-03-06 16:56:51 +00:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.10/keypairs-get-resp.json
|
2016-04-23 02:26:11 +08:00
|
|
|
:language: javascript
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Delete Keypair
|
|
|
|
==============
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: DELETE /os-keypairs/{keypair_name}
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 02:26:11 +08:00
|
|
|
Deletes a keypair.
|
|
|
|
|
2016-06-03 09:50:43 -04:00
|
|
|
Normal response codes: 202, 204
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The normal return code is 204 in version 2.2 to match the fact that
|
|
|
|
no body content is returned.
|
2016-04-23 02:26:11 +08:00
|
|
|
|
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
2017-01-16 18:42:21 +09:00
|
|
|
- keypair_name: keypair_name_path
|
|
|
|
- user_id: keypair_user
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-06-03 09:50:43 -04:00
|
|
|
|
2016-07-07 10:23:34 +08:00
|
|
|
There is no body content for the response of a successful DELETE query
|