api-v2 icon indicating copy to clipboard operation
api-v2 copied to clipboard

Search by Droplet name

Open jbenesch opened this issue 6 years ago • 4 comments

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?

jbenesch avatar Apr 09 '18 17:04 jbenesch

There's a uservoice "idea" for this feature here, voting might help make it happen.

davidshepherd7 avatar Oct 10 '18 13:10 davidshepherd7

This UserVoice instance is no longer available.

doctl seems to be able to do this, is it using v1?

erichelgeson avatar Mar 06 '20 20:03 erichelgeson

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.

andrewsomething avatar Mar 06 '20 20:03 andrewsomething

Oh, I was referring to doctl compute droplet list 'test*' - though must seemingly do the same?

erichelgeson avatar Mar 08 '20 15:03 erichelgeson