Key pair API reference¶
See https://docs.openstack.org/api-ref/compute/.
In these methods, {keypair_name}
is a placeholder that should be replaced with the actual name of the key pair. The API allows you to list existing key pairs, show details of a specific key pair, create a new key pair or import an existing one, and delete a key pair. When creating a new key pair, the response includes the private key (which you should save securely). When importing a key pair, provide the public key in the request body.
List key pairs¶
Show key pair details¶
Create or import a key pair¶
Request body (for creating a new key pair)
Request body (for importing an existing key pair)
JSON
{
"keypair": {
"name": "keypair_name",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ..."
}
}