ServerMania logo

Set SSH Keys

Note that the following API request will be deprecated in the future releases.

To assign SSH keys of all administrators and a VS owner to a virtual server, use the following request:

POST /virtual_machines/:virtual_machine_id/set_ssh_keys.xml
POST /virtual_machines/:virtual_machine_id/set_ssh_keys.json

XML Request Example

curl -X POST -u user:userpass http://test/virtual_machines/12/set_ssh_keys.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' 

JSON Request Example

curl -X POST -u user:userpass http://test/virtual_machines/12/set_ssh_keys.json -H 'Accept: application/json' -H 'Content-type: application/json'


New API Request


To assign SSH keys of all administrators and a VS owner to a virtual server, use the following request:

PUT /virtual_machines/:virtual_machine_id/set_ssh_keys.xml
PUT /virtual_machines/:virtual_machine_id/set_ssh_keys.json


XML Request Example

curl -X PUT -u user:userpass http://test/virtual_machines/iycweptranzwjt/set_ssh_keys.xml -H 'Accept: application/xml' -H 'Content-Type: application/xml'

JSON Request Example

curl -X PUT -u user:userpass http://test/virtual_machines/iycweptranzwjt/set_ssh_keys.json -H 'Accept: application/json' -H 'Content-Type: application/json'