-
Notifications
You must be signed in to change notification settings - Fork 81
/
object_storage_clusters.go
36 lines (30 loc) · 1.12 KB
/
object_storage_clusters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package linodego
import (
"context"
)
// ObjectStorageCluster represents a linode object storage cluster object
type ObjectStorageCluster struct {
ID string `json:"id"`
Domain string `json:"domain"`
Status string `json:"status"`
Region string `json:"region"`
StaticSiteDomain string `json:"static_site_domain"`
}
// ListObjectStorageClusters lists ObjectStorageClusters
func (c *Client) ListObjectStorageClusters(ctx context.Context, opts *ListOptions) ([]ObjectStorageCluster, error) {
response, err := getPaginatedResults[ObjectStorageCluster](ctx, c, "object-storage/clusters", opts)
if err != nil {
return nil, err
}
return response, nil
}
// Deprecated: GetObjectStorageCluster uses a deprecated API endpoint.
// GetObjectStorageCluster gets the template with the provided ID
func (c *Client) GetObjectStorageCluster(ctx context.Context, clusterID string) (*ObjectStorageCluster, error) {
e := formatAPIPath("object-storage/clusters/%s", clusterID)
response, err := doGETRequest[ObjectStorageCluster](ctx, c, e)
if err != nil {
return nil, err
}
return response, nil
}