How can I locate a Host via API inside the self host

I trying use Rancher API to locate me, a host, to change things. I don’t found anything that help todo this.

I need find some information that help-me user API to found the host.
Ex.:
http://rancher.host/v1/hosts?hostname=ip-172-31-0-30

att.

curl -s http://169.254.169.250/2015-12-29/self/host/uuid will give you the UUID of the host you’re on, and then you can get that with http://rancher.host/v1/hosts?uuid=UUID

Hostname is not a filterable field (and is not necessarily unique anyway)

2 Likes

I’m getting this error:
ubuntu@ip-172-31-0-30:~$ curl -s http://169.254.169.250/2015-12-29/latest/self/host/uuid
Invalid version

Thanks.

Works when I change a metadata vesion , linke this:

curl -s http://169.254.169.250/2015-12-19/self/host/uuid

Thanks.

Sorry, I added the dated version but forgot to remove the"latest"… Updated