Skip to content

Commit

Permalink
feat(objsto): add support for creating and deleting buckets (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangasta authored Oct 9, 2024
1 parent ab507ed commit 9bf4072
Show file tree
Hide file tree
Showing 7 changed files with 1,448 additions and 138 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]

### Added
- Managed Load Balancer: `MatchingCondition` field to frontend rule for controlling which operator to use when combining matchers
- managed load balancer: `MatchingCondition` field to frontend rule for controlling which operator to use when combining matchers
- managed object storage: support for creating and deleting buckets
- managed object storage: `Deleted` field to `upcloud.ManagedObjectStorageBucketMetrics`

## [8.8.1]

Expand Down
1 change: 1 addition & 0 deletions upcloud/managed_object_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ type ManagedObjectStorageUserAccessKey struct {
// ManagedObjectStorageBucketMetrics represents metrics for a Managed Object Storage service bucket
type ManagedObjectStorageBucketMetrics struct {
Name string `json:"name"`
Deleted bool `json:"deleted"`
TotalObjects int `json:"total_objects"`
TotalSizeBytes int `json:"total_size_bytes"`
}
Expand Down
34 changes: 33 additions & 1 deletion upcloud/request/managed_object_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@ func (r *GetManagedObjectStorageBucketMetricsRequest) RequestURL() string {
return path
}

type CreateManagedObjectStorageBucketRequest struct {
ServiceUUID string `json:"-"`
Name string `json:"name"`
}

// RequestURL implements the Request interface
func (r *CreateManagedObjectStorageBucketRequest) RequestURL() string {
return fmt.Sprintf("%s/%s/buckets", managedObjectStorageBasePath, r.ServiceUUID)
}

type DeleteManagedObjectStorageBucketRequest struct {
ServiceUUID string `json:"-"`
Name string `json:"-"`
}

// RequestURL implements the Request interface
func (r *DeleteManagedObjectStorageBucketRequest) RequestURL() string {
return fmt.Sprintf("%s/%s/buckets/%s", managedObjectStorageBasePath, r.ServiceUUID, r.Name)
}

// CreateManagedObjectStorageNetworkRequest represents a request for creating a network
type CreateManagedObjectStorageNetworkRequest struct {
Family string `json:"family"`
Expand Down Expand Up @@ -442,11 +462,23 @@ func (r *WaitForManagedObjectStorageOperationalStateRequest) RequestURL() string
// WaitForManagedObjectStorageDeletionRequest represents a request to wait for a Managed Object Storage service
// to be deleted
type WaitForManagedObjectStorageDeletionRequest struct {
DesiredState upcloud.ManagedObjectStorageOperationalState `json:"-"`
DesiredState upcloud.ManagedObjectStorageOperationalState `json:"-"` // Deprecated: The managed object storage instance has no state after being deleted.
UUID string `json:"-"`
}

// RequestURL implements the Request interface
func (r *WaitForManagedObjectStorageDeletionRequest) RequestURL() string {
return fmt.Sprintf("%s/%s", managedObjectStorageBasePath, r.UUID)
}

// WaitForManagedObjectStorageDeletionRequest represents a request to wait for a Managed Object Storage service
// to be deleted
type WaitForManagedObjectStorageBucketDeletionRequest struct {
ServiceUUID string `json:"-"`
Name string `json:"-"`
}

// RequestURL implements the Request interface
func (r *WaitForManagedObjectStorageBucketDeletionRequest) RequestURL() string {
return fmt.Sprintf("%s/%s/buckets", managedObjectStorageBasePath, r.ServiceUUID)
}
129 changes: 0 additions & 129 deletions upcloud/service/fixtures/getmanagedobjectstoragebucketmetrics.yaml

This file was deleted.

Loading

0 comments on commit 9bf4072

Please sign in to comment.