Yes, everything the UI does is through the API. Generate an API key for the environment in the browser (User icon menu -> API & Keys), then save the access key, secret key, and endpoint URL somewhere.
(I will assume the endpoint is environment/project “1a5”, the default environment)
GET /v1/projects/1a5/hosts will list all the host resources
- For all requests, send the access and secret key as the HTTP Basic auth username & password
curl -u 'accesskey:secretkey' 'http://your-rancher:8080/v1/projects/1a5/hosts' | jq .
- Find the host you’re interested in in there; it will have a
links map in the JSON, one of which is
- Follow that link to get the physicalHost resource, e.g.
- The physicalHost resource will similarly have a
config link if it was created through docker-machine.
- GETting that link will give you the same tarball you download from the UI. From there you can untar it to get the
id_rsa file to SSH to it.