DigitalOceanPHP / Client

DigitalOcean API v2 client for PHP
MIT License
709 stars 205 forks source link

Feature request: delete droplet by tag #282

Closed webignition closed 3 years ago

webignition commented 3 years ago

I have the need to delete a droplet without necessarily knowing the id of the droplet.

The API supports doing so but neither the 4.3 or 4.4 branches appear to support this (apologies if I missed something).

The addition of a method to DigitalOceanV2\Api\Droplet seems straightforward and, aside from possible method name considerations, could take the form:

public function removeAll(string $tag): void
{
    $this->delete('droplets', ['tag_name' => $tag]);
}

I'm happy to implement this change in a fork, including the addition of tests and the updating of documentation.

I'd just like to check:

webignition commented 3 years ago

After attempting implementation, I realise that the above method suggestion won't work but have determined what will.

GrahamCampbell commented 3 years ago

Merged into 4.4. :)

webignition commented 3 years ago

Awesome!