Skip to content

Commit

Permalink
feat(block): remove SnapshotSummary (#2000)
Browse files Browse the repository at this point in the history
Co-authored-by: Mia-Cross <lmarabese@scaleway.com>
  • Loading branch information
scaleway-bot and Mia-Cross authored Feb 14, 2024
1 parent 4c24add commit 3271ecd
Showing 1 changed file with 32 additions and 70 deletions.
102 changes: 32 additions & 70 deletions api/block/v1alpha1/block_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,29 @@ func (enum *VolumeStatus) UnmarshalJSON(data []byte) error {
return nil
}

// Reference: reference.
type Reference struct {
// ID: UUID of the reference.
ID string `json:"id"`

// ProductResourceType: type of resource to which the reference is associated.
ProductResourceType string `json:"product_resource_type"`

// ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
ProductResourceID string `json:"product_resource_id"`

// CreatedAt: creation date of the reference.
CreatedAt *time.Time `json:"created_at"`

// Type: type of reference (link, exclusive, read_only).
// Default value: unknown_type
Type ReferenceType `json:"type"`

// Status: status of reference (attaching, attached, detaching).
// Default value: unknown_status
Status ReferenceStatus `json:"status"`
}

// SnapshotParentVolume: snapshot parent volume.
type SnapshotParentVolume struct {
// ID: parent volume UUID (volume from which the snapshot originates).
Expand All @@ -340,29 +363,6 @@ type VolumeSpecifications struct {
Class StorageClass `json:"class"`
}

// Reference: reference.
type Reference struct {
// ID: UUID of the reference.
ID string `json:"id"`

// ProductResourceType: type of resource to which the reference is associated.
ProductResourceType string `json:"product_resource_type"`

// ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
ProductResourceID string `json:"product_resource_id"`

// CreatedAt: creation date of the reference.
CreatedAt *time.Time `json:"created_at"`

// Type: type of reference (link, exclusive, read_only).
// Default value: unknown_type
Type ReferenceType `json:"type"`

// Status: status of reference (attaching, attached, detaching).
// Default value: unknown_status
Status ReferenceStatus `json:"status"`
}

// CreateVolumeRequestFromEmpty: create volume request from empty.
type CreateVolumeRequestFromEmpty struct {
// Size: must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
Expand All @@ -379,18 +379,18 @@ type CreateVolumeRequestFromSnapshot struct {
SnapshotID string `json:"snapshot_id"`
}

// SnapshotSummary: snapshot summary.
type SnapshotSummary struct {
// Snapshot: snapshot.
type Snapshot struct {
// ID: UUID of the snapshot.
ID string `json:"id"`

// Name: name of the snapshot.
Name string `json:"name"`

// ParentVolume: if the parent volume has been deleted, value is null.
// ParentVolume: if the parent volume was deleted, value is null.
ParentVolume *SnapshotParentVolume `json:"parent_volume"`

// Size: size of the snapshot in bytes.
// Size: size in bytes of the snapshot.
Size scw.Size `json:"size"`

// ProjectID: UUID of the project the snapshot belongs to.
Expand All @@ -402,14 +402,17 @@ type SnapshotSummary struct {
// UpdatedAt: last modification date of the properties of a snapshot.
UpdatedAt *time.Time `json:"updated_at"`

// References: list of the references to the snapshot.
References []*Reference `json:"references"`

// Status: current status of the snapshot (available, in_use, ...).
// Default value: unknown_status
Status SnapshotStatus `json:"status"`

// Tags: list of tags assigned to the volume.
Tags []string `json:"tags"`

// Zone: snapshot Availability Zone.
// Zone: snapshot zone.
Zone scw.Zone `json:"zone"`

// Class: storage class of the snapshot.
Expand Down Expand Up @@ -590,7 +593,7 @@ type ListSnapshotsRequest struct {
// ListSnapshotsResponse: list snapshots response.
type ListSnapshotsResponse struct {
// Snapshots: paginated returned list of snapshots.
Snapshots []*SnapshotSummary `json:"snapshots"`
Snapshots []*Snapshot `json:"snapshots"`

// TotalCount: total number of snpashots in the project.
TotalCount uint64 `json:"total_count"`
Expand Down Expand Up @@ -711,47 +714,6 @@ func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint64, error) {
return uint64(len(results.Volumes)), nil
}

// Snapshot: snapshot.
type Snapshot struct {
// ID: UUID of the snapshot.
ID string `json:"id"`

// Name: name of the snapshot.
Name string `json:"name"`

// ParentVolume: if the parent volume was deleted, value is null.
ParentVolume *SnapshotParentVolume `json:"parent_volume"`

// Size: size in bytes of the snapshot.
Size scw.Size `json:"size"`

// ProjectID: UUID of the project the snapshot belongs to.
ProjectID string `json:"project_id"`

// CreatedAt: creation date of the snapshot.
CreatedAt *time.Time `json:"created_at"`

// UpdatedAt: last modification date of the properties of a snapshot.
UpdatedAt *time.Time `json:"updated_at"`

// References: list of the references to the snapshot.
References []*Reference `json:"references"`

// Status: current status of the snapshot (available, in_use, ...).
// Default value: unknown_status
Status SnapshotStatus `json:"status"`

// Tags: list of tags assigned to the volume.
Tags []string `json:"tags"`

// Zone: snapshot zone.
Zone scw.Zone `json:"zone"`

// Class: storage class of the snapshot.
// Default value: unknown_storage_class
Class StorageClass `json:"class"`
}

// UpdateSnapshotRequest: update snapshot request.
type UpdateSnapshotRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config.
Expand Down

0 comments on commit 3271ecd

Please sign in to comment.