var result ClusterList=ClustersGet(ctx) .Limit(limit) .Offset(offset) .FilterName(filterName) .Execute()
List clusters
Example
packagemainimport ("context""fmt""os" ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-postgres")funcmain() { limit := int32(100) // int32 | The maximum number of elements to return. Use together with 'offset' for pagination. (optional) (default to 100)
offset := int32(200) // int32 | The first element to return. Use together with 'limit' for pagination. (optional) (default to 0)
filterName := "filterName_example" // string | Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. (optional)
configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") apiClient := ionoscloud.NewAPIClient(configuration) resource, resp, err := apiClient.ClustersApi.ClustersGet(context.Background()).Limit(limit).Offset(offset).FilterName(filterName).Execute()
if err !=nil { fmt.Fprintf(os.Stderr, "Error when calling `ClustersApi.ClustersGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) }// response from `ClustersGet`: ClusterList fmt.Fprintf(os.Stdout, "Response from `ClustersApi.ClustersGet`: %v\n", resource)}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiClustersGetRequest struct via the builder pattern
context for authentication, logging, cancellation, deadlines, tracing, etc.
clusterId
string
The unique ID of the cluster.
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
clusterId
string
The unique ID of the cluster.
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
clusterId
string
The unique ID of the cluster.
limit
int32
The maximum number of elements to return. Use together with 'offset' for pagination.
[default to 100]
offset
int32
The first element to return. Use together with 'limit' for pagination.
[default to 0]
filterName
string
Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field.
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.