Deleting a key pair

This section explains how to delete a key pair.

Deletion of a key pair is basically the procedure for creating a key pair done in reverse.

  1. Set the environment variable below as follows:
    $ TMP_KEYPAIR_NAME=<keyPairIdTargetedForDeletion>
  2. Execute the following API:
    $ curl -X DELETE -Ss -i $COMPUTE/v2/$PROJECT_ID/os-keypairs/\
    $TMP_KEYPAIR_NAME -H "X-Auth-Token:$OS_AUTH_TOKEN" \
    -H "Content-Type:application/json"
    HTTP/1.1 204 No Content
    Server:  Apache
    Date:  Www, DD MMM yyyy hh:mm:ss GMT
    x-compute-request-id:  req-<reqId>
    Cache-Control:  no-cache
    X-Request-Id:  <xReqId>
    X-Runtime:  <runtime>
    Keep-Alive:  timeout=5, max=100
    Content-Type:  text/html; charset=UTF-8
    Content-Length:  0