Deleting SSH keys
DELETE /os-keypairs/{keypair_name}
Delete a key pair with the specified name.
Source: https://docs.openstack.org/api-ref/compute/index.html?expanded=delete-keypair-detail#delete-keypair
Request
Parameters
Name | In | Type | Description |
---|---|---|---|
keypair_name
|
path | string | The key pair name. |
user_id (Optional) |
body | string |
The user ID for a key pair. This allows administrative users to upload keys for other users than themselves. New in version 2.10 |
Example
# curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \ https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/os-keypairs/key2
Response
Status codes
Success
Code | Reason |
---|---|
202 - Accepted
|
Request was accepted for processing, but the processing has not been completed. A ‘location’ header is included in the response which contains a link to check the progress of the request. |
204 - No Content
|
The server has fulfilled the request. |
Error
Code | Reason |
---|---|
401 - Unauthorized
|
User must authenticate before making a request. |
403 - Forbidden
|
Policy does not allow current user to do this operation. |
404 - Not Found
|
The requested resource could not be found. |