Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When you have questions about the Nova API, one of the best things you can do is run the nova command line client with the --debug flag, which will show you exactly what requests are being made. For example, if you run:

nova --debug keypair-create testkey

You see that it makes a POST to the /v2/<tenant_id>/os-keypairs endpoint:

curl -i '' -X POST [...]
  -d '{"keypair": {"name": "testkey"}}'

And that it gets back a JSON response containing both a public_key and private_key keys:

  "keypair": {
    "fingerprint": "20:41:b0:e1:0d:df:3e:00:b3:c0:8d:37:a8:a2:dd:f0",
    "name": "testkey",
    "user_id": "564bafe6f37f4d88bd028c12d47d6dde",
    "private_key": "-----BEGIN RSA PRIVATE KEY-----...",
    "public_key": "ssh-rsa ...",

And this is hopefully exactly what you need.