godo.Droplets.ListByTag()
Generated on 5 Nov 2026
from godo version
v1.236.0
Usage
client.Droplets.ListByTag(ctx context.Context, tag string, opt *godo.ListOptions) ([]godo.Droplet, *godo.Response, error)Description
ListByTag lists all Droplets matched by a Tag.
This method sends a GET request to /v2/droplets.
Parameters
tagstring requiredopt*godo.ListOptions
Fields of godo.ListOptions
ListOptions specifies the optional parameters to various List methods that
support pagination.
PageintFor paginated result sets, page of results to retrieve.
PerPageintFor paginated result sets, the number of results to include per page.
WithProjectsboolWhether App responses should include project_id fields. The field will be empty if false or if omitted. (ListApps)
DeployedboolThis parameter is used to only list agents that are deployed in the response.
PublicOnlyboolThis parameter is used to include models that are publicly available.
Usecases[]stringThis parameter is used to include models according to the use cases.
Returns
- []godo.Droplet
- *godo.Response
The HTTP response, with pagination
Links,Meta, andRatelimit information.- error
Non-nil when the request fails. API errors are returned as
*godo.ErrorResponse.
Fields of godo.Droplet
Droplet represents a DigitalOcean Droplet
IDintNamestringMemoryintVcpusintDiskintRegion*godo.RegionImage*godo.ImageSize*godo.SizeSizeSlugstringBackupIDs[]intNextBackupWindow*godo.BackupWindowSnapshotIDs[]intFeatures[]stringLockedboolStatusstringNetworks*godo.NetworksCreatedstringKernel*godo.KernelTags[]stringVolumeIDs[]stringVPCUUIDstringSubnetUUIDstringGPUPartitionModestringGPUPartitionModeis echoed back on create when the Droplet was created
with a partitioned GPU. Note: read-back on droplet GET is not delivered in
v1, so this is only reliably populated on the create response.
Request Sample
Pagination
This method returns one page of results. Response.Links carries the pagination state; loop until IsLastPage reports true.
Response Example
More Information
See GET /v2/droplets in the API reference for additional detail on responses, headers, parameters, and more.
See the Go package documentation for the source of this method.