Header

Create known host

This method allows you to create a new known host in a project template.

URL

/templates/<permalink>/build_known_hosts
  • Replace <permalink> with the permalink of the template.

HTTP Method

POST

Supported Parameters

  • hostname - the hostname of the permitted known host
  • public_key - the public host key of the known host

Example cURL request

curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
-X POST \
-d '{ \
  "build_known_host":{ \
    "hostname":"codebasehq.com" \
    "public_key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqafgFtYVquYfReJa3MGIyGz0RZoc1kfnXHFDjprY4Uy0lwia+35rRa9Aycrf4eySa55JXsg7rOosqpNOi2hSFWHQ/FfKzMH077Vu1X6d5gNBzxR3aJq/zaAJSiRbrUM20NgEHzBiT8x+32zM71E4qjKnGG8AdEqV9AmROXHWddLSs3e5Tsr2+Dkc/lu+Ko4eVjFjW3ZUgTRE3VTd+PDSRGOfmimgBpcuhkBbEyK4+dq7NJKxLbUl9zC7jKPddkWpbonR9CYWj+c8R8MimKLhhSilNRUKuQBNYydol3eX8VNi+PTzAYtB/w8/jl3+BWzj6xAyfMRdeJDyhhTYX+/s+w=="\
  } \
}' 
https://atech.deployhq.com/templates/api-created/build_known_hosts/

Example response

{
  "identifier":"4eb9cb76-777c-415c-9768-7be926c811d3",
  "hostname":"codebasehq.com",
  "fingerprint":"2e:db:b6:22:f7:bd:48:f6:da:72:bf:59:d7:75:d7:4e"
}