godo.ADS.ListWorkspaces()

Generated on 23 Nov 2026 from godo version v1.245.0

Usage

client.ADS.ListWorkspaces(ctx context.Context, region string) (*godo.ADSWorkspacesResponse, *godo.Response, error)

Description

ListWorkspaces returns the workspaces in region.

Parameters

region string required

Returns

*godo.ADSWorkspacesResponse
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.ADSWorkspacesResponse

ADSWorkspacesResponse is the body of ListWorkspaces.

Workspaces []godo.ADSWorkspace

JSON key: workspaces

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.ADS.ListWorkspaces(ctx, "<your-region>")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

More Information

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.