godo.MicroVMs.ListByName()
Generated on 5 Nov 2026
from godo version
v1.236.0
Usage
client.MicroVMs.ListByName(ctx context.Context, name string, opt *godo.ListOptions) ([]godo.MicroVM, *godo.Response, error)Description
ListByName lists MicroVMs filtered by exact name match, with optional pagination.
This method sends a GET request to /v2/microvms.
Parameters
namestring 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.MicroVM
- *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.MicroVM
MicroVM represents a DigitalOcean MicroVM.
IDstringNamestringRegionstringStategodo.MicroVMStateSize*godo.MicroVMSizeURLs[]godo.MicroVMURLPorts[]uint32FailureReasonstringNetworkinggodo.MicroVMNetworkingSource*godo.MicroVMSourceAutoPause*godo.AutoPauseConfigAutoResume*boolHTTPProtocolgodo.MicroVMHTTPProtocolCreatedstringTags[]stringEgressPolicy*godo.MicroVMEgressPolicyEgressPolicyis the outbound allow list set at create, as supplied.
Nil when theMicroVMhas no policy and egress is unrestricted.
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/microvms in the API reference for additional detail on responses, headers, parameters, and more.
See the Go package documentation for the source of this method.