api-v2
api-v2 copied to clipboard
Search by Droplet name
In the digital ocean dashboard, there is a search box at the top that allows a client to search droplets by name (hostname). It looks to be using V1 of the API: https://cloud.digitalocean.com/api/v1/droplets/search?include_failed=true&page=1&preserveScrollPosition=false&query=the&sort=created_at&sort_direction=desc
I'm trying to replicate that exact same functionality so users in our CRM can locate droplets based off of the domain name. In the V2 docs I don't see how I am able to do that. I see that I can "tag" droplets and lookup droplets based on that tag list droplets by tag. Maybe that is now the preferred way? Seems like tags are meant to group droplets and not have unique tags for every droplet?
Any reason I can't lookup droplets by hostname in V2 of the API? What am I missing or what is the recommended approach to search droplets by domain/hostname?
There's a uservoice "idea" for this feature here, voting might help make it happen.
This UserVoice instance is no longer available.
doctl
seems to be able to do this, is it using v1?
Hi @erichelgeson,
The DigitalOcean ideas portal was move from UserVoice to a different service. Unfortunately, this broken existing links. The current link for that suggestion is at: https://ideas.digitalocean.com/ideas/DO-I-1777
The doctl ssh
subcommand does support referring to Droplets by hostname, but it does this by retrieving the list of Droplets from the API and looping through them until the correct one is found.
Oh, I was referring to doctl compute droplet list 'test*'
- though must seemingly do the same?