diff options
author | Sylvain Bauza <sbauza@redhat.com> | 2022-07-08 17:23:01 +0200 |
---|---|---|
committer | Sylvain Bauza <sbauza@redhat.com> | 2022-07-28 11:05:50 +0200 |
commit | a755e5d9f25c7bb06533a3799d9c39b74f334873 (patch) | |
tree | d5ff4cba5b9c734940b6b229340336583d58f32b /api-ref | |
parent | 09239fc2eadcf266b42c640e386c7cebad715eea (diff) | |
download | nova-a755e5d9f25c7bb06533a3799d9c39b74f334873.tar.gz |
api: Drop generating a keypair and add special chars to naming
As agreed in the spec, we will both drop the generation support for a keypair
but we'll also accept @ (at) and . (dot) chars in the keyname, all of them in
the same API microversion.
Rebased the work from I5de15935e83823afa545a250cf84f6a7a37036b4
APIImpact
Implements: blueprint keypair-generation-removal
Co-Authored-By: Nicolas Parquet <nicolas.parquet@gandi.net>
Change-Id: I6a7c71fb4385348c87067543d0454f302907395e
Diffstat (limited to 'api-ref')
-rw-r--r-- | api-ref/source/os-keypairs.inc | 22 | ||||
-rw-r--r-- | api-ref/source/parameters.yaml | 20 |
2 files changed, 35 insertions, 7 deletions
diff --git a/api-ref/source/os-keypairs.inc b/api-ref/source/os-keypairs.inc index e03e7d91aa..76099fad16 100644 --- a/api-ref/source/os-keypairs.inc +++ b/api-ref/source/os-keypairs.inc @@ -44,12 +44,16 @@ Response .. literalinclude:: ../../doc/api_samples/os-keypairs/v2.35/keypairs-list-resp.json :language: javascript -Create Or Import Keypair -======================== +Import (or create) Keypair +========================== .. rest_method:: POST /os-keypairs -Generates or imports a keypair. +Imports (or generates) a keypair. + +.. warning:: + + Generating a keypair is no longer possible starting from version 2.92. Normal response codes: 200, 201 @@ -65,7 +69,7 @@ Request .. rest_parameters:: parameters.yaml - keypair: keypair - - name: keypair_name + - name: keypair_name_in - public_key: keypair_public_key_in - type: keypair_type_in - user_id: keypair_userid_in @@ -75,6 +79,11 @@ Request .. literalinclude:: ../../doc/api_samples/os-keypairs/v2.10/keypairs-import-post-req.json :language: javascript +**Example Import Keypair (v2.92): JSON request** + +.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.92/keypairs-import-post-req.json + :language: javascript + Response -------- @@ -93,6 +102,11 @@ Response .. literalinclude:: ../../doc/api_samples/os-keypairs/v2.10/keypairs-import-post-resp.json :language: javascript +**Example Import Keypair (v2.92): JSON response** + +.. literalinclude:: ../../doc/api_samples/os-keypairs/v2.92/keypairs-import-post-resp.json + :language: javascript + Show Keypair Details ==================== diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 9853ad23f1..63f0f58963 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -4414,7 +4414,19 @@ keypair_name: required: true type: string description: | + The name for the keypair. +keypair_name_in: + in: body + required: true + type: string + description: | A name for the keypair which will be used to reference it later. + + .. note:: + + Since microversion 2.92, allowed characters are ASCII letters + ``[a-zA-Z]``, digits ``[0-9]`` and the following special + characters: ``[@._- ]``. keypair_private_key: description: | If you do not provide a public key on create, a new keypair will @@ -4424,6 +4436,7 @@ keypair_private_key: in: body required: false type: string + max_version: 2.91 keypair_public_key: description: | The keypair public key. @@ -4432,10 +4445,11 @@ keypair_public_key: type: string keypair_public_key_in: description: | - The public ssh key to import. If you omit this value, a keypair is - generated for you. + The public ssh key to import. + Was optional before microversion 2.92 : if you were omitting this value, a + keypair was generated for you. in: body - required: false + required: true type: string keypair_type: in: body |