block

package
v1.0.0-beta.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Package block provides methods and message types of the block v1alpha1 API.

Index

Constants

View Source
const (
	// Order by creation date (ascending chronological order).
	ListSnapshotsRequestOrderByCreatedAtAsc = ListSnapshotsRequestOrderBy("created_at_asc")
	// Order by creation date (descending chronological order).
	ListSnapshotsRequestOrderByCreatedAtDesc = ListSnapshotsRequestOrderBy("created_at_desc")
	// Order by name (ascending order).
	ListSnapshotsRequestOrderByNameAsc = ListSnapshotsRequestOrderBy("name_asc")
	// Order by name (descending order).
	ListSnapshotsRequestOrderByNameDesc = ListSnapshotsRequestOrderBy("name_desc")
)
View Source
const (
	// Order by creation date (ascending chronological order).
	ListVolumesRequestOrderByCreatedAtAsc = ListVolumesRequestOrderBy("created_at_asc")
	// Order by creation date (descending chronological order).
	ListVolumesRequestOrderByCreatedAtDesc = ListVolumesRequestOrderBy("created_at_desc")
	// Order by name (ascending order).
	ListVolumesRequestOrderByNameAsc = ListVolumesRequestOrderBy("name_asc")
	// Order by name (descending order).
	ListVolumesRequestOrderByNameDesc = ListVolumesRequestOrderBy("name_desc")
)
View Source
const (
	// If unspecified, the status of the reference is unknown by default.
	ReferenceStatusUnknownStatus = ReferenceStatus("unknown_status")
	// When the reference is being attached (transient).
	ReferenceStatusAttaching = ReferenceStatus("attaching")
	// When the reference attached to a volume.
	ReferenceStatusAttached = ReferenceStatus("attached")
	// When the reference is being detached (transient).
	ReferenceStatusDetaching = ReferenceStatus("detaching")
	// When the reference is detached from a volume - the reference ceases to exist.
	ReferenceStatusDetached = ReferenceStatus("detached")
	// Reference under creation which can be rolled back if an error occurs (transient).
	ReferenceStatusCreating = ReferenceStatus("creating")
	// Error status.
	ReferenceStatusError = ReferenceStatus("error")
)
View Source
const (
	// If unspecified, the reference type is unknown by default.
	ReferenceTypeUnknownType = ReferenceType("unknown_type")
	// Reference linked to a snapshot (for snapshots only).
	ReferenceTypeLink = ReferenceType("link")
	// Exclusive reference that can be associated to a volume (for volumes only).
	ReferenceTypeExclusive = ReferenceType("exclusive")
	// Access to the volume or snapshot in a read-only mode, without storage write access to the resource.
	ReferenceTypeReadOnly = ReferenceType("read_only")
)
View Source
const (
	// If unspecified, the snapshot status is unknown by default.
	SnapshotStatusUnknownStatus = SnapshotStatus("unknown_status")
	// The snapshot is under creation (transient).
	SnapshotStatusCreating = SnapshotStatus("creating")
	// Snapshot exists and is not attached to any reference.
	SnapshotStatusAvailable = SnapshotStatus("available")
	// Snapshot in an error status.
	SnapshotStatusError = SnapshotStatus("error")
	// Snapshot is being deleted (transient).
	SnapshotStatusDeleting = SnapshotStatus("deleting")
	// Snapshot was deleted.
	SnapshotStatusDeleted = SnapshotStatus("deleted")
	// Snapshot attached to one or more references.
	SnapshotStatusInUse  = SnapshotStatus("in_use")
	SnapshotStatusLocked = SnapshotStatus("locked")
)
View Source
const (
	// If unspecified, the Storage Class is unknown by default.
	StorageClassUnknownStorageClass = StorageClass("unknown_storage_class")
	// No specific Storage Class selected.
	StorageClassUnspecified = StorageClass("unspecified")
	// Classic storage.
	StorageClassBssd = StorageClass("bssd")
	// Performance storage with lower latency.
	StorageClassSbs = StorageClass("sbs")
)
View Source
const (
	// If unspecified, the volume status is unknown by default.
	VolumeStatusUnknownStatus = VolumeStatus("unknown_status")
	// The volume is under creation (transient).
	VolumeStatusCreating = VolumeStatus("creating")
	// The volume exists and is not attached to any reference.
	VolumeStatusAvailable = VolumeStatus("available")
	// The volume exists and is already attached to a reference.
	VolumeStatusInUse = VolumeStatus("in_use")
	// The volume undergoing deletion (transient).
	VolumeStatusDeleting = VolumeStatus("deleting")
	VolumeStatusDeleted  = VolumeStatus("deleted")
	// The volume is being increased (transient).
	VolumeStatusResizing = VolumeStatus("resizing")
	// The volume is an error status.
	VolumeStatusError = VolumeStatus("error")
	// The volume is undergoing snapshotting operation (transient).
	VolumeStatusSnapshotting = VolumeStatus("snapshotting")
	VolumeStatusLocked       = VolumeStatus("locked")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

This API allows you to use and manage your Block Storage volumes.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateSnapshot

func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)

CreateSnapshot: To create a snapshot, the volume must be in the `in_use` or the `available` status. If your volume is in a transient state, you need to wait until the end of the current operation.

func (*API) CreateVolume

func (s *API) CreateVolume(req *CreateVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

CreateVolume: To create a new volume from scratch, you must specify `from_empty` and the `size`. To create a volume from an existing snapshot, specify `from_snapshot` and the `snapshot_id` in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot.

func (*API) DeleteSnapshot

func (s *API) DeleteSnapshot(req *DeleteSnapshotRequest, opts ...scw.RequestOption) error

DeleteSnapshot: You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.

func (*API) DeleteVolume

func (s *API) DeleteVolume(req *DeleteVolumeRequest, opts ...scw.RequestOption) error

DeleteVolume: You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.

func (*API) GetSnapshot

func (s *API) GetSnapshot(req *GetSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)

GetSnapshot: Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response.

func (*API) GetVolume

func (s *API) GetVolume(req *GetVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

GetVolume: Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response.

func (*API) ListSnapshots

func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption) (*ListSnapshotsResponse, error)

ListSnapshots: List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.

func (*API) ListVolumeTypes

func (s *API) ListVolumeTypes(req *ListVolumeTypesRequest, opts ...scw.RequestOption) (*ListVolumeTypesResponse, error)

ListVolumeTypes: List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.

func (*API) ListVolumes

func (s *API) ListVolumes(req *ListVolumesRequest, opts ...scw.RequestOption) (*ListVolumesResponse, error)

ListVolumes: List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.

func (*API) UpdateSnapshot

func (s *API) UpdateSnapshot(req *UpdateSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)

UpdateSnapshot: Update the name or tags of the snapshot.

func (*API) UpdateVolume

func (s *API) UpdateVolume(req *UpdateVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

UpdateVolume: Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class). You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.

func (*API) WaitForSnapshot

func (s *API) WaitForSnapshot(req *WaitForSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)

WaitForSnapshot wait for the snapshot to be in a "terminal state" before returning.

func (*API) WaitForVolume

func (s *API) WaitForVolume(req *WaitForVolumeRequest, opts ...scw.RequestOption) (*Volume, error)

WaitForVolume waits for the volume to be in a "terminal state" before returning.

func (*API) WaitForVolumeAndReferences

func (s *API) WaitForVolumeAndReferences(req *WaitForVolumeAndReferencesRequest, opts ...scw.RequestOption) (*Volume, error)

WaitForVolumeAndReferences waits for the volume and its references to be in a "terminal state" before returning.

func (*API) Zones

func (s *API) Zones() []scw.Zone

type CreateSnapshotRequest

type CreateSnapshotRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// VolumeID: UUID of the volume to snapshot.
	VolumeID string `json:"volume_id"`

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

	// ProjectID: UUID of the project to which the volume and the snapshot belong.
	ProjectID string `json:"project_id"`

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

CreateSnapshotRequest: create snapshot request.

type CreateVolumeRequest

type CreateVolumeRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

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

	// PerfIops: the maximum IO/s expected, according to the different options available in stock (`5000 | 15000`).
	// Precisely one of PerfIops must be set.
	PerfIops *uint32 `json:"perf_iops,omitempty"`

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

	// FromEmpty: specify the size of the new volume if creating a new one from scratch.
	// Precisely one of FromEmpty, FromSnapshot must be set.
	FromEmpty *CreateVolumeRequestFromEmpty `json:"from_empty,omitempty"`

	// FromSnapshot: specify the snapshot ID of the original snapshot.
	// Precisely one of FromEmpty, FromSnapshot must be set.
	FromSnapshot *CreateVolumeRequestFromSnapshot `json:"from_snapshot,omitempty"`

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

CreateVolumeRequest: create volume request.

type CreateVolumeRequestFromEmpty

type CreateVolumeRequestFromEmpty struct {
	// Size: must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
	Size scw.Size `json:"size"`
}

CreateVolumeRequestFromEmpty: create volume request from empty.

type CreateVolumeRequestFromSnapshot

type CreateVolumeRequestFromSnapshot struct {
	// Size: must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
	// Size is optional and is used only if a resize of the volume is requested, otherwise original snapshot size will be used.
	Size *scw.Size `json:"size"`

	// SnapshotID: source snapshot from which volume will be created.
	SnapshotID string `json:"snapshot_id"`
}

CreateVolumeRequestFromSnapshot: create volume request from snapshot.

type DeleteSnapshotRequest

type DeleteSnapshotRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// SnapshotID: UUID of the snapshot.
	SnapshotID string `json:"-"`
}

DeleteSnapshotRequest: delete snapshot request.

type DeleteVolumeRequest

type DeleteVolumeRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// VolumeID: UUID of the volume.
	VolumeID string `json:"-"`
}

DeleteVolumeRequest: delete volume request.

type GetSnapshotRequest

type GetSnapshotRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// SnapshotID: UUID of the snapshot.
	SnapshotID string `json:"-"`
}

GetSnapshotRequest: get snapshot request.

type GetVolumeRequest

type GetVolumeRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// VolumeID: UUID of the volume.
	VolumeID string `json:"-"`
}

GetVolumeRequest: get volume request.

type ListSnapshotsRequest

type ListSnapshotsRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// OrderBy: criteria to use when ordering the list.
	// Default value: created_at_asc
	OrderBy ListSnapshotsRequestOrderBy `json:"-"`

	// ProjectID: filter by Project ID.
	ProjectID *string `json:"-"`

	// OrganizationID: filter by Organization ID.
	OrganizationID *string `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: page size, defines how many entries are returned in one page, must be lower or equal to 100.
	PageSize *uint32 `json:"-"`

	// VolumeID: filter snapshots by the ID of the original volume.
	VolumeID *string `json:"-"`

	// Name: filter snapshots by their names.
	Name *string `json:"-"`
}

ListSnapshotsRequest: list snapshots request.

type ListSnapshotsRequestOrderBy

type ListSnapshotsRequestOrderBy string

func (ListSnapshotsRequestOrderBy) MarshalJSON

func (enum ListSnapshotsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListSnapshotsRequestOrderBy) String

func (enum ListSnapshotsRequestOrderBy) String() string

func (*ListSnapshotsRequestOrderBy) UnmarshalJSON

func (enum *ListSnapshotsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListSnapshotsResponse

type ListSnapshotsResponse struct {
	// Snapshots: paginated returned list of snapshots.
	Snapshots []*Snapshot `json:"snapshots"`

	// TotalCount: total number of snpashots in the project.
	TotalCount uint64 `json:"total_count"`
}

ListSnapshotsResponse: list snapshots response.

func (*ListSnapshotsResponse) UnsafeAppend

func (r *ListSnapshotsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListSnapshotsResponse) UnsafeGetTotalCount

func (r *ListSnapshotsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListVolumeTypesRequest

type ListVolumeTypesRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: page size, defines how many entries are returned in one page, must be lower or equal to 100.
	PageSize *uint32 `json:"-"`
}

ListVolumeTypesRequest: list volume types request.

type ListVolumeTypesResponse

type ListVolumeTypesResponse struct {
	// VolumeTypes: returns paginated list of volume-types.
	VolumeTypes []*VolumeType `json:"volume_types"`

	// TotalCount: total number of volume-types currently available in stock.
	TotalCount uint64 `json:"total_count"`
}

ListVolumeTypesResponse: list volume types response.

func (*ListVolumeTypesResponse) UnsafeAppend

func (r *ListVolumeTypesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListVolumeTypesResponse) UnsafeGetTotalCount

func (r *ListVolumeTypesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListVolumesRequest

type ListVolumesRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// OrderBy: criteria to use when ordering the list.
	// Default value: created_at_asc
	OrderBy ListVolumesRequestOrderBy `json:"-"`

	// ProjectID: filter by Project ID.
	ProjectID *string `json:"-"`

	// OrganizationID: filter by Organization ID.
	OrganizationID *string `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: page size, defines how many entries are returned in one page, must be lower or equal to 100.
	PageSize *uint32 `json:"-"`

	// Name: filter the return volumes by their names.
	Name *string `json:"-"`

	// ProductResourceID: filter by a product resource ID linked to this volume (such as an Instance ID).
	ProductResourceID *string `json:"-"`
}

ListVolumesRequest: list volumes request.

type ListVolumesRequestOrderBy

type ListVolumesRequestOrderBy string

func (ListVolumesRequestOrderBy) MarshalJSON

func (enum ListVolumesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListVolumesRequestOrderBy) String

func (enum ListVolumesRequestOrderBy) String() string

func (*ListVolumesRequestOrderBy) UnmarshalJSON

func (enum *ListVolumesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListVolumesResponse

type ListVolumesResponse struct {
	// Volumes: paginated returned list of volumes.
	Volumes []*Volume `json:"volumes"`

	// TotalCount: total number of volumes in the project.
	TotalCount uint64 `json:"total_count"`
}

ListVolumesResponse: list volumes response.

func (*ListVolumesResponse) UnsafeAppend

func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListVolumesResponse) UnsafeGetTotalCount

func (r *ListVolumesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type 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"`
}

Reference: reference.

type ReferenceStatus

type ReferenceStatus string

func (ReferenceStatus) MarshalJSON

func (enum ReferenceStatus) MarshalJSON() ([]byte, error)

func (ReferenceStatus) String

func (enum ReferenceStatus) String() string

func (*ReferenceStatus) UnmarshalJSON

func (enum *ReferenceStatus) UnmarshalJSON(data []byte) error

type ReferenceType

type ReferenceType string

func (ReferenceType) MarshalJSON

func (enum ReferenceType) MarshalJSON() ([]byte, error)

func (ReferenceType) String

func (enum ReferenceType) String() string

func (*ReferenceType) UnmarshalJSON

func (enum *ReferenceType) UnmarshalJSON(data []byte) error

type 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"`
}

Snapshot: snapshot.

type SnapshotParentVolume

type SnapshotParentVolume struct {
	// ID: parent volume UUID (volume from which the snapshot originates).
	ID string `json:"id"`

	// Name: name of the parent volume.
	Name string `json:"name"`

	// Type: volume type of the parent volume.
	Type string `json:"type"`

	// Status: current status the parent volume.
	// Default value: unknown_status
	Status VolumeStatus `json:"status"`
}

SnapshotParentVolume: snapshot parent volume.

type SnapshotStatus

type SnapshotStatus string

func (SnapshotStatus) MarshalJSON

func (enum SnapshotStatus) MarshalJSON() ([]byte, error)

func (SnapshotStatus) String

func (enum SnapshotStatus) String() string

func (*SnapshotStatus) UnmarshalJSON

func (enum *SnapshotStatus) UnmarshalJSON(data []byte) error

type StorageClass

type StorageClass string

func (StorageClass) MarshalJSON

func (enum StorageClass) MarshalJSON() ([]byte, error)

func (StorageClass) String

func (enum StorageClass) String() string

func (*StorageClass) UnmarshalJSON

func (enum *StorageClass) UnmarshalJSON(data []byte) error

type UpdateSnapshotRequest

type UpdateSnapshotRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// SnapshotID: UUID of the snapshot.
	SnapshotID string `json:"-"`

	// Name: when defined, is the name of the snapshot.
	Name *string `json:"name,omitempty"`

	// Tags: list of tags assigned to the snapshot.
	Tags *[]string `json:"tags,omitempty"`
}

UpdateSnapshotRequest: update snapshot request.

type UpdateVolumeRequest

type UpdateVolumeRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`

	// VolumeID: UUID of the volume.
	VolumeID string `json:"-"`

	// Name: when defined, is the new name of the volume.
	Name *string `json:"name,omitempty"`

	// Size: size in bytes of the volume, with a granularity of 1 GB (10^9 bytes).
	// Must be compliant with the minimum (1GB) and maximum (10TB) allowed size.
	Size *scw.Size `json:"size,omitempty"`

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

	// PerfIops: the selected value must be available for the volume's current storage class.
	PerfIops *uint32 `json:"perf_iops,omitempty"`
}

UpdateVolumeRequest: update volume request.

type Volume

type Volume struct {
	// ID: UUID of the volume.
	ID string `json:"id"`

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

	// Type: volume type.
	Type string `json:"type"`

	// Size: volume size in bytes.
	Size scw.Size `json:"size"`

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

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

	// UpdatedAt: last update of the properties of a volume.
	UpdatedAt *time.Time `json:"updated_at"`

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

	// ParentSnapshotID: when a volume is created from a snapshot, is the UUID of the snapshot from which the volume has been created.
	ParentSnapshotID *string `json:"parent_snapshot_id"`

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

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

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

	// Specs: specifications of the volume.
	Specs *VolumeSpecifications `json:"specs"`

	// LastDetachedAt: last time the volume was detached.
	LastDetachedAt *time.Time `json:"last_detached_at"`
}

Volume: volume.

type VolumeSpecifications

type VolumeSpecifications struct {
	// PerfIops: the maximum IO/s expected, according to the different options available in stock (`5000 | 15000`).
	PerfIops *uint32 `json:"perf_iops"`

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

VolumeSpecifications: volume specifications.

type VolumeStatus

type VolumeStatus string

func (VolumeStatus) MarshalJSON

func (enum VolumeStatus) MarshalJSON() ([]byte, error)

func (VolumeStatus) String

func (enum VolumeStatus) String() string

func (*VolumeStatus) UnmarshalJSON

func (enum *VolumeStatus) UnmarshalJSON(data []byte) error

type VolumeType

type VolumeType struct {
	// Type: volume type.
	Type string `json:"type"`

	// Pricing: price of the volume billed in GB/hour.
	Pricing *scw.Money `json:"pricing"`

	// SnapshotPricing: price of the snapshot billed in GB/hour.
	SnapshotPricing *scw.Money `json:"snapshot_pricing"`

	// Specs: volume specifications of the volume type.
	Specs *VolumeSpecifications `json:"specs"`
}

VolumeType: volume type.

type WaitForSnapshotRequest

type WaitForSnapshotRequest struct {
	SnapshotID    string
	Zone          scw.Zone
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForSnapshotRequest is used by WaitForSnapshot method.

type WaitForVolumeAndReferencesRequest

type WaitForVolumeAndReferencesRequest struct {
	VolumeID      string
	Zone          scw.Zone
	Timeout       *time.Duration
	RetryInterval *time.Duration

	VolumeTerminalStatus    *VolumeStatus
	ReferenceTerminalStatus *ReferenceStatus
}

WaitForVolumeAndReferencesRequest is used by WaitForVolumeAndReferences method.

type WaitForVolumeRequest

type WaitForVolumeRequest struct {
	VolumeID      string
	Zone          scw.Zone
	Timeout       *time.Duration
	RetryInterval *time.Duration

	// If set, will wait until this specific status has been reached or the
	// volume has an error status. This is useful when we need to wait for
	// the volume to transition from "in_use" to "available".
	TerminalStatus *VolumeStatus
}

WaitForVolumeRequest is used by WaitForVolume method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL