disks

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

API Actor api, this actor is the final api a enduser uses to manage his resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	// ID of the account
	// Required: true
	AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`

	// ID of the grid (platform)
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// Name of disk
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// Description of disk
	// Required: false
	Description string `url:"description,omitempty" json:"description,omitempty"`

	// Size in GB, default is 0
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`

	// Type of disk
	//	- B=Boot
	//	- D=Data
	//	- T=Temp
	// Required: true
	Type string `url:"type" json:"type" validate:"diskType"`

	// Size in GB default is 0
	// Required: false
	SSDSize uint64 `url:"ssdSize,omitempty" json:"ssdSize,omitempty"`

	// Max IOPS disk can perform defaults to 2000
	// Required: false
	IOPS uint64 `url:"iops,omitempty" json:"iops,omitempty"`

	// Storage endpoint provider ID to create disk
	// Required: false
	SEPID uint64 `url:"sep_id,omitempty" json:"sep_id,omitempty"`

	// Pool name to create disk
	// Required: false
	Pool string `url:"pool,omitempty" json:"pool,omitempty"`
}

CreateRequest struct to create disk

type DeleteRequest

type DeleteRequest struct {
	// ID of disk to delete
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// Detach disk from machine first
	// Required: false
	Detach bool `url:"detach,omitempty" json:"detach,omitempty"`

	// Whether to completely delete the disk, works only with non attached disks
	// Required: false
	Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`

	// Reason to delete
	// Required: false
	Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}

DeleteRequest to delete disk

type Disks

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

Structure for creating request to disks

func New

func New(client interfaces.Caller) *Disks

Builder for disks endpoints

func (Disks) Create

func (d Disks) Create(ctx context.Context, req CreateRequest) (uint64, error)

Create creates a disk

func (Disks) Delete

func (d Disks) Delete(ctx context.Context, req DeleteRequest) (bool, error)

Delete deletes disk by ID

func (Disks) DeleteDisks

func (d Disks) DeleteDisks(ctx context.Context, req DisksDeleteRequest) (bool, error)

DeleteDisks deletes multiple disks permanently

func (Disks) Get

func (d Disks) Get(ctx context.Context, req GetRequest) (*RecordDisk, error)

Get gets disk details as a RecordDisk struct Notice: the devicename field is the name as it is passed to the kernel (kname in linux) for unattached disks this field has no relevant value

func (Disks) GetRaw added in v1.6.6

func (d Disks) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)

GetRaw gets disk details as an array of bytes Notice: the devicename field is the name as it is passed to the kernel (kname in linux) for unattached disks this field has no relevant value

func (Disks) LimitIO

func (d Disks) LimitIO(ctx context.Context, req LimitIORequest) (bool, error)

LimitIO limit IO for a certain disk total and read/write options are not allowed to be combined see http://libvirt.org/formatdomain.html#elementsDisks iotune section for more details

func (Disks) List

func (d Disks) List(ctx context.Context, req ListRequest) (*ListDisks, error)

List gets list of the created disks belonging to an account as a ListDisks struct

func (Disks) ListDeleted

func (d Disks) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListDisks, error)

ListDeleted gets list the deleted disks belonging to an account

func (Disks) ListRaw added in v1.6.6

func (d Disks) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of the created disks belonging to an account as an array of bytes

func (Disks) ListTypes

func (d Disks) ListTypes(ctx context.Context, req ListTypesRequest) (*ListTypes, error)

ListTypes gets list defined disk types

func (Disks) ListUnattached

func (d Disks) ListUnattached(ctx context.Context, req ListUnattachedRequest) (*ListDisksUnattached, error)

ListUnattached gets list of unattached disks

func (Disks) Rename

func (d Disks) Rename(ctx context.Context, req RenameRequest) (bool, error)

Rename renames disk

func (Disks) Resize

func (d Disks) Resize(ctx context.Context, req ResizeRequest) (bool, error)

Resize resizes disk Returns 200 if disk is resized online, else will return 202, in that case please stop and start your machine after changing the disk size, for your changes to be reflected. This method will not be used for disks, assigned to computes. Only unassigned disks and disks, assigned with "old" virtual machines.

func (Disks) Resize2

func (d Disks) Resize2(ctx context.Context, req ResizeRequest) (bool, error)

Resize2 resize disk Returns 200 if disk is resized online, else will return 202, in that case please stop and start your machine after changing the disk size, for your changes to be reflected. This method will not be used for disks, assigned to "old" virtual machines. Only unassigned disks and disks, assigned with computes.

func (Disks) Restore

func (d Disks) Restore(ctx context.Context, req RestoreRequest) (bool, error)

Restore restores a deleted unattached disk from recycle bin

func (Disks) Search

func (d Disks) Search(ctx context.Context, req SearchRequest) (ListSearchDisks, error)

Search searches disks

func (Disks) Share

func (d Disks) Share(ctx context.Context, req ShareRequest) (bool, error)

Share shares data disk

func (Disks) SnapshotDelete

func (d Disks) SnapshotDelete(ctx context.Context, req SnapshotDeleteRequest) (bool, error)

SnapshotDelete deletes a snapshot

func (Disks) SnapshotRollback

func (d Disks) SnapshotRollback(ctx context.Context, req SnapshotRollbackRequest) (bool, error)

SnapshotRollback rollbacks an individual disk snapshot

func (Disks) Unshare

func (d Disks) Unshare(ctx context.Context, req UnshareRequest) (bool, error)

Unshare unshares data disk

type DisksDeleteRequest

type DisksDeleteRequest struct {
	// List of disk ids to delete
	// Required: true
	DisksIDs []uint64 `url:"diskIds" json:"diskIds" validate:"required"`

	// Reason for deleting the disks
	// Required: true
	Reason string `url:"reason" json:"reason" validate:"required"`

	// Whether to completely delete the disks, works only with non attached disks
	// Required: false
	Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}

DisksDeleteRequest struct for multiple disks

type GetRequest

type GetRequest struct {
	// ID of the disk
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
}

GetRequest struct to get information about disk

type IOTune

type IOTune struct {
	// ReadBytesSec
	ReadBytesSec uint64 `json:"read_bytes_sec"`

	// ReadBytesSecMax
	ReadBytesSecMax uint64 `json:"read_bytes_sec_max"`

	// ReadIOPSSec
	ReadIOPSSec uint64 `json:"read_iops_sec"`

	// ReadIOPSSecMax
	ReadIOPSSecMax uint64 `json:"read_iops_sec_max"`

	// SizeIOPSSec
	SizeIOPSSec uint64 `json:"size_iops_sec"`

	// TotalBytesSec
	TotalBytesSec uint64 `json:"total_bytes_sec"`

	// TotalBytesSecMax
	TotalBytesSecMax uint64 `json:"total_bytes_sec_max"`

	// TotalIOPSSec
	TotalIOPSSec uint64 `json:"total_iops_sec"`

	// TotalIOPSSecMax
	TotalIOPSSecMax uint64 `json:"total_iops_sec_max"`

	// WriteBytesSec
	WriteBytesSec uint64 `json:"write_bytes_sec"`

	// WriteBytesSecMax
	WriteBytesSecMax uint64 `json:"write_bytes_sec_max"`

	// WriteIOPSSec
	WriteIOPSSec uint64 `json:"write_iops_sec"`

	// WriteIOPSSecMax
	WriteIOPSSecMax uint64 `json:"write_iops_sec_max"`
}

Main information about IO tune

type ItemDisk

type ItemDisk struct {
	// Access Control List
	ACL map[string]interface{} `json:"acl"`

	// Account ID
	AccountID uint64 `json:"accountId"`

	// Account name
	AccountName string `json:"accountName"`

	// Computes
	Computes map[string]string `json:"computes"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Device name
	DeviceName string `json:"devicename"`

	// Description
	Description string `json:"desc"`

	// Destruction time
	DestructionTime uint64 `json:"destructionTime"`

	// Grid ID
	GID uint64 `json:"gid"`

	// ID
	ID uint64 `json:"id"`

	// Image ID
	ImageID uint64 `json:"imageId"`

	// List of image IDs
	Images []uint64 `json:"images"`

	// IOTune
	IOTune IOTune `json:"iotune"`

	// Machine ID
	MachineID uint64 `json:"machineId"`

	// Machine name
	MachineName string `json:"machineName"`

	// Name
	Name string `json:"name"`

	// Order
	Order uint64 `json:"order"`

	// Params
	Params string `json:"params"`

	// Parent ID
	ParentID uint64 `json:"parentId"`

	// PCI slot
	PCISlot int64 `json:"pciSlot"`

	// Pool
	Pool string `json:"pool"`

	// Present to
	PresentTo []uint64 `json:"presentTo"`

	// Purge time
	PurgeTime uint64 `json:"purgeTime"`

	// Resource ID
	ResID string `json:"resId"`

	// Resource name
	ResName string `json:"resName"`

	// Role
	Role string `json:"role"`

	// SepType
	SepType string `json:"sepType"`

	// Shareable
	Shareable bool `json:"shareable"`

	// SepID
	SepID uint64 `json:"sepId"`

	// Size max
	SizeMax uint64 `json:"sizeMax"`

	// Size used
	SizeUsed float64 `json:"sizeUsed"`

	// List of snapshots
	Snapshots ListSnapshots `json:"snapshots"`

	// Status
	Status string `json:"status"`

	// Tech status
	TechStatus string `json:"techStatus"`

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

	// Virtual machine ID
	VMID uint64 `json:"vmid"`
}

Main information about disk

func (ItemDisk) Serialize

func (idisk ItemDisk) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ItemDiskUnattached added in v1.3.1

type ItemDiskUnattached struct {
	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// Account ID
	AccountID uint64 `json:"accountId"`

	// Account name
	AccountName string `json:"accountName"`

	// Access Control List
	ACL map[string]interface{} `json:"acl"`

	// Boot Partition
	BootPartition uint64 `json:"bootPartition"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Description
	Description string `json:"desc"`

	// Destruction time
	DestructionTime uint64 `json:"destructionTime"`

	// Disk path
	DiskPath string `json:"diskPath"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// Image ID
	ImageID uint64 `json:"imageId"`

	// Images
	Images []uint64 `json:"images"`

	// IOTune
	IOTune IOTune `json:"iotune"`

	// IQN
	IQN string `json:"iqn"`

	// Login
	Login string `json:"login"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Name
	Name string `json:"name"`

	// Order
	Order uint64 `json:"order"`

	// Params
	Params string `json:"params"`

	// Parent ID
	ParentID uint64 `json:"parentId"`

	// Password
	Password string `json:"passwd"`

	//PCISlot
	PCISlot int64 `json:"pciSlot"`

	// Pool
	Pool string `json:"pool"`

	// Present to
	PresentTo []uint64 `json:"presentTo"`

	// Purge attempts
	PurgeAttempts uint64 `json:"purgeAttempts"`

	// Purge time
	PurgeTime uint64 `json:"purgeTime"`

	// Reality device number
	RealityDeviceNumber uint64 `json:"realityDeviceNumber"`

	// Reference ID
	ReferenceID string `json:"referenceId"`

	// Resource ID
	ResID string `json:"resId"`

	// Resource name
	ResName string `json:"resName"`

	// Role
	Role string `json:"role"`

	// ID SEP
	SEPID uint64 `json:"sepId"`

	// Shareable
	Shareable bool `json:"shareable"`

	// Size max
	SizeMax uint64 `json:"sizeMax"`

	// Size used
	SizeUsed float64 `json:"sizeUsed"`

	// List of snapshots
	Snapshots ListSnapshots `json:"snapshots"`

	// Status
	Status string `json:"status"`

	// Tech status
	TechStatus string `json:"techStatus"`

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

	// Virtual machine ID
	VMID uint64 `json:"vmid"`
}

func (ItemDiskUnattached) Serialize added in v1.3.1

func (idisk ItemDiskUnattached) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ItemSnapshot

type ItemSnapshot struct {
	// GUID
	GUID string `json:"guid"`

	// Label
	Label string `json:"label"`

	ReferenceID string `json:"referenceId"`

	// Resource ID
	ResID string `json:"resId"`

	// SnapSetGUID
	SnapSetGUID string `json:"snapSetGuid"`

	// SnapSetTime
	SnapSetTime uint64 `json:"snapSetTime"`

	// TimeStamp
	TimeStamp uint64 `json:"timestamp"`
}

Main information about snapshot

type LimitIORequest

type LimitIORequest struct {
	// ID of the disk to limit
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// Alias for total_iops_sec for backwards compatibility
	// Required: false
	IOPS uint64 `url:"iops,omitempty" json:"iops,omitempty"`

	// TotalBytesSec
	// Required: false
	TotalBytesSec uint64 `url:"total_bytes_sec,omitempty" json:"total_bytes_sec,omitempty"`

	// ReadBytesSec
	// Required: false
	ReadBytesSec uint64 `url:"read_bytes_sec,omitempty" json:"read_bytes_sec,omitempty"`

	// WriteBytesSec
	// Required: false
	WriteBytesSec uint64 `url:"write_bytes_sec,omitempty" json:"write_bytes_sec,omitempty"`

	// TotalIOPSSec
	// Required: false
	TotalIOPSSec uint64 `url:"total_iops_sec,omitempty" json:"total_iops_sec,omitempty"`

	// ReadIOPSSec
	// Required: false
	ReadIOPSSec uint64 `url:"read_iops_sec,omitempty" json:"read_iops_sec,omitempty"`

	// WriteIOPSSec
	// Required: false
	WriteIOPSSec uint64 `url:"write_iops_sec,omitempty" json:"write_iops_sec,omitempty"`

	// TotalBytesSecMax
	// Required: false
	TotalBytesSecMax uint64 `url:"total_bytes_sec_max,omitempty" json:"total_bytes_sec_max,omitempty"`

	// ReadBytesSecMax
	// Required: false
	ReadBytesSecMax uint64 `url:"read_bytes_sec_max,omitempty" json:"read_bytes_sec_max,omitempty"`

	// WriteBytesSecMax
	// Required: false
	WriteBytesSecMax uint64 `url:"write_bytes_sec_max,omitempty" json:"write_bytes_sec_max,omitempty"`

	// TotalIOPSSecMax
	// Required: false
	TotalIOPSSecMax uint64 `url:"total_iops_sec_max,omitempty" json:"total_iops_sec_max,omitempty"`

	// ReadIOPSSecMax
	// Required: false
	ReadIOPSSecMax uint64 `url:"read_iops_sec_max,omitempty" json:"read_iops_sec_max,omitempty"`

	// WriteIOPSSecMax
	// Required: false
	WriteIOPSSecMax uint64 `url:"write_iops_sec_max,omitempty" json:"write_iops_sec_max,omitempty"`

	// SizeIOPSSec
	// Required: false
	SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
}

LimitIORequest struct for limit IO

type ListDeletedRequest added in v1.5.0

type ListDeletedRequest struct {
	// Find by id
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by account name
	// Required: false
	AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"`

	// Find by max size disk
	// Required: false
	DiskMaxSize int64 `url:"diskMaxSize,omitempty" json:"diskMaxSize,omitempty"`

	// Find by shared, true or false
	// Required: false
	Shared bool `url:"shared,omitempty" json:"shared,omitempty"`

	// ID of the account the disks belong to
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Type of the disks
	// Required: false
	Type string `url:"type,omitempty" json:"type,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListDeletedRequest struct to get list of deleted disks

type ListDisks

type ListDisks struct {
	// Data
	Data []ItemDisk `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List of disks

func (ListDisks) FilterByComputeID added in v1.3.0

func (ld ListDisks) FilterByComputeID(computeID uint64) ListDisks

FilterByComputeID is used to filter ListDisks attached to specified compute.

func (ListDisks) FilterByID

func (ld ListDisks) FilterByID(id uint64) ListDisks

FilterByID returns ListDisks with specified ID.

func (ListDisks) FilterByK8SID added in v1.3.0

func (ld ListDisks) FilterByK8SID(ctx context.Context, k8sID uint64, decortClient interfaces.Caller) (*ListDisks, error)

FilterByK8SID is used to filter ListDisks by specified K8S cluster.

func (ListDisks) FilterByLBID added in v1.3.0

func (ld ListDisks) FilterByLBID(ctx context.Context, lbID uint64, decortClient interfaces.Caller) (*ListDisks, error)

FilterByLBID is used to filter ListDisks used by computes inside specified Load Balancer.

func (ListDisks) FilterByName

func (ld ListDisks) FilterByName(name string) ListDisks

FilterByName returns ListDisks with specified Name.

func (ListDisks) FilterByStatus

func (ld ListDisks) FilterByStatus(status string) ListDisks

FilterByStatus returns ListDisks with specified Status.

func (ListDisks) FilterByTechStatus

func (ld ListDisks) FilterByTechStatus(techStatus string) ListDisks

FilterByTechStatus returns ListDisks with specified TechStatus.

func (ListDisks) FilterFunc

func (ld ListDisks) FilterFunc(predicate func(ItemDisk) bool) ListDisks

FilterFunc allows filtering ListDisks based on a user-specified predicate.

func (ListDisks) FindOne

func (ld ListDisks) FindOne() ItemDisk

FindOne returns first found ItemDisk If none was found, returns an empty struct.

func (ListDisks) IDs added in v1.6.8

func (ld ListDisks) IDs() []uint64

IDs gets array of DiskIDs from ListDisks struct

func (ListDisks) Serialize

func (ld ListDisks) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

func (ListDisks) SortByCreatedTime

func (ld ListDisks) SortByCreatedTime(inverse bool) ListDisks

SortByCreatedTime sorts ListDisks by the CreatedTime field in ascending order.

If inverse param is set to true, the order is reversed.

func (ListDisks) SortByDeletedTime

func (ld ListDisks) SortByDeletedTime(inverse bool) ListDisks

SortByDeletedTime sorts ListDisks by the DeletedTime field in ascending order.

If inverse param is set to true, the order is reversed.

func (ListDisks) SortByDestructionTime

func (ld ListDisks) SortByDestructionTime(inverse bool) ListDisks

SortByDestructionTime sorts ListDisks by the DestructionTime field in ascending order.

If inverse param is set to true, the order is reversed.

type ListDisksUnattached added in v1.3.1

type ListDisksUnattached struct {
	Data []ItemDiskUnattached `json:"data"`

	EntryCount uint64 `json:"entryCount"`
}

List of unattached disks

func (ListDisksUnattached) FilterByID added in v1.3.1

FilterByID returns ListDisksUnattached with specified ID.

func (ListDisksUnattached) FilterByName added in v1.3.1

func (lu ListDisksUnattached) FilterByName(name string) ListDisksUnattached

FilterByName returns ListDisksUnattached with specified Name.

func (ListDisksUnattached) FilterByStatus added in v1.3.1

func (lu ListDisksUnattached) FilterByStatus(status string) ListDisksUnattached

FilterByStatus returns ListDisksUnattached with specified Status.

func (ListDisksUnattached) FilterByTechStatus added in v1.3.1

func (lu ListDisksUnattached) FilterByTechStatus(techStatus string) ListDisksUnattached

FilterByTechStatus returns ListDisksUnattached with specified TechStatus.

func (ListDisksUnattached) FilterFunc added in v1.3.1

func (lu ListDisksUnattached) FilterFunc(predicate func(ItemDiskUnattached) bool) ListDisksUnattached

FilterFunc allows filtering ListDisksUnattached based on a user-specified predicate.

func (ListDisksUnattached) FindOne added in v1.3.1

FindOne returns first found ItemDiskUnattached If none was found, returns an empty struct.

func (ListDisksUnattached) IDs added in v1.6.8

func (ldu ListDisksUnattached) IDs() []uint64

IDs gets array of DiskIDs from ListDisksUnattached struct

func (ListDisksUnattached) Serialize added in v1.3.1

func (lu ListDisksUnattached) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

func (ListDisksUnattached) SortByCreatedTime added in v1.3.1

func (lu ListDisksUnattached) SortByCreatedTime(inverse bool) ListDisksUnattached

SortByCreatedTime sorts ListDisksUnattached by the CreatedTime field in ascending order.

If inverse param is set to true, the order is reversed.

func (ListDisksUnattached) SortByDeletedTime added in v1.3.1

func (lu ListDisksUnattached) SortByDeletedTime(inverse bool) ListDisksUnattached

SortByDeletedTime sorts ListDisksUnattached by the DeletedTime field in ascending order.

If inverse param is set to true, the order is reversed.

func (ListDisksUnattached) SortByDestructionTime added in v1.3.1

func (lu ListDisksUnattached) SortByDestructionTime(inverse bool) ListDisksUnattached

SortByDestructionTime sorts ListDisksUnattached by the DestructionTime field in ascending order.

If inverse param is set to true, the order is reversed.

type ListRequest

type ListRequest struct {
	// Find by id
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by account name
	// Required: false
	AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"`

	// Find by max size disk
	// Required: false
	DiskMaxSize int64 `url:"diskMaxSize,omitempty" json:"diskMaxSize,omitempty"`

	// Find by status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Find by shared, true or false
	// Required: false
	Shared bool `url:"shared,omitempty" json:"shared,omitempty"`

	// ID of the account the disks belong to
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Type of the disks
	// Required: false
	Type string `url:"type,omitempty" json:"type,omitempty"`

	// Find by sep ID
	// Required: false
	SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`

	// Find by pool name
	// Required: false
	Pool string `url:"pool,omitempty" json:"pool,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListRequest struct to get list of disks

type ListSearchDisks added in v1.5.0

type ListSearchDisks []ItemDisk

List of disks searched

func (ListSearchDisks) FilterByComputeID added in v1.5.0

func (ld ListSearchDisks) FilterByComputeID(computeID uint64) ListSearchDisks

FilterByComputeID is used to filter ListSearchDisks attached to specified compute.

func (ListSearchDisks) FilterByID added in v1.5.0

func (ld ListSearchDisks) FilterByID(id uint64) ListSearchDisks

FilterByID returns ListSearchDisks with specified ID.

func (ListSearchDisks) FilterByK8SID added in v1.5.0

func (ld ListSearchDisks) FilterByK8SID(ctx context.Context, k8sID uint64, decortClient interfaces.Caller) (ListSearchDisks, error)

FilterByK8SID is used to filter ListSearchDisks by specified K8S cluster.

func (ListSearchDisks) FilterByLBID added in v1.5.0

func (ld ListSearchDisks) FilterByLBID(ctx context.Context, lbID uint64, decortClient interfaces.Caller) (ListSearchDisks, error)

FilterByLBID is used to filter ListSearchDisks used by computes inside specified Load Balancer.

func (ListSearchDisks) FilterByName added in v1.5.0

func (ld ListSearchDisks) FilterByName(name string) ListSearchDisks

FilterByName returns ListSearchDisks with specified Name.

func (ListSearchDisks) FilterByStatus added in v1.5.0

func (ld ListSearchDisks) FilterByStatus(status string) ListSearchDisks

FilterByStatus returns ListSearchDisks with specified Status.

func (ListSearchDisks) FilterByTechStatus added in v1.5.0

func (ld ListSearchDisks) FilterByTechStatus(techStatus string) ListSearchDisks

FilterByTechStatus returns ListSearchDisks with specified TechStatus.

func (ListSearchDisks) FilterFunc added in v1.5.0

func (ld ListSearchDisks) FilterFunc(predicate func(ItemDisk) bool) ListSearchDisks

FilterFunc allows filtering ListSearchDisks based on a user-specified predicate.

func (ListSearchDisks) FindOne added in v1.5.0

func (ld ListSearchDisks) FindOne() ItemDisk

FindOne returns first found ItemDisk If none was found, returns an empty struct.

func (ListSearchDisks) IDs added in v1.6.8

func (lsd ListSearchDisks) IDs() []uint64

IDs gets array of DiskIDs from ListSearchDisks struct

func (ListSearchDisks) Serialize added in v1.5.0

func (ld ListSearchDisks) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

func (ListSearchDisks) SortByCreatedTime added in v1.5.0

func (ld ListSearchDisks) SortByCreatedTime(inverse bool) ListSearchDisks

SortByCreatedTime sorts ListSearchDisks by the CreatedTime field in ascending order.

If inverse param is set to true, the order is reversed.

func (ListSearchDisks) SortByDeletedTime added in v1.5.0

func (ld ListSearchDisks) SortByDeletedTime(inverse bool) ListSearchDisks

SortByDeletedTime sorts ListSearchDisks by the DeletedTime field in ascending order.

If inverse param is set to true, the order is reversed.

func (ListSearchDisks) SortByDestructionTime added in v1.5.0

func (ld ListSearchDisks) SortByDestructionTime(inverse bool) ListSearchDisks

SortByDestructionTime sorts ListSearchDisks by the DestructionTime field in ascending order.

If inverse param is set to true, the order is reversed.

type ListSnapshots

type ListSnapshots []ItemSnapshot

List of snapshots

type ListTypes added in v1.5.0

type ListTypes struct {
	// Data
	Data []interface{} `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

type ListTypesRequest

type ListTypesRequest struct {
	// Show detailed disk types by seps
	// Required: true
	Detailed bool `url:"detailed" json:"detailed" validate:"required"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListTypesRequest struct to get list types of disks

type ListUnattachedRequest

type ListUnattachedRequest struct {
	// Find by id
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by account name
	// Required: false
	AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"`

	// Find by max size disk
	// Required: false
	DiskMaxSize int64 `url:"diskMaxSize,omitempty" json:"diskMaxSize,omitempty"`

	// Find by status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Type of the disks
	// Required: false
	Type string `url:"type,omitempty" json:"type,omitempty"`

	// ID of the account
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Find by sep ID
	// Required: false
	SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`

	// Find by pool name
	// Required: false
	Pool string `url:"pool,omitempty" json:"pool,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListUnattachedRequest struct to get list of unattached disk

type RecordDisk

type RecordDisk struct {
	// Access Control List
	ACL map[string]interface{} `json:"acl"`

	// Account ID
	AccountID uint64 `json:"accountId"`

	// Account name
	AccountName string `json:"accountName"`

	// Computes
	Computes map[string]string `json:"computes"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	// Device name
	DeviceName string `json:"devicename"`

	// Description
	Description string `json:"desc"`

	// Destruction time
	DestructionTime uint64 `json:"destructionTime"`

	// Grid ID
	GID uint64 `json:"gid"`

	// ID
	ID uint64 `json:"id"`

	// Image ID
	ImageID uint64 `json:"imageId"`

	// List of image IDs
	Images []uint64 `json:"images"`

	// IOTune
	IOTune IOTune `json:"iotune"`

	// Name
	Name string `json:"name"`

	// Order
	Order uint64 `json:"order"`

	// Params
	Params string `json:"params"`

	// Parent ID
	ParentID uint64 `json:"parentId"`

	// PCI slot
	PCISlot int64 `json:"pciSlot"`

	// Pool
	Pool string `json:"pool"`

	// Present to
	PresentTo []uint64 `json:"presentTo"`

	// Purge time
	PurgeTime uint64 `json:"purgeTime"`

	// Resource ID
	ResID string `json:"resId"`

	// Resource name
	ResName string `json:"resName"`

	// Role
	Role string `json:"role"`

	// SepType
	SepType string `json:"sepType"`

	// SepID
	SepID uint64 `json:"sepId"`

	// Shareable
	Shareable bool `json:"shareable"`

	// Size max
	SizeMax uint64 `json:"sizeMax"`

	// Size used
	SizeUsed float64 `json:"sizeUsed"`

	// List of snapshots
	Snapshots ListSnapshots `json:"snapshots"`

	// Status
	Status string `json:"status"`

	// Tech status
	TechStatus string `json:"techStatus"`

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

	// Virtual machine ID
	VMID uint64 `json:"vmid"`
}

Detailed information about disk

type RenameRequest

type RenameRequest struct {
	// ID of the disk to rename
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// New name of disk
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`
}

RenameRequest struct to rename disk

type ResizeRequest

type ResizeRequest struct {
	// ID of the disk to resize
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// New size of the disk in GB
	// Required: true
	Size uint64 `url:"size" json:"size" validate:"required"`
}

ResizeRequest struct to resize disk

type RestoreRequest

type RestoreRequest struct {
	// ID of the disk to restore
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// Reason for restoring the disk
	// Required: true
	Reason string `url:"reason" json:"reason" validate:"required"`
}

RestoreRequest struct to restore a deleted unattached disk

type SearchRequest

type SearchRequest struct {
	//  ID of the account to search for the Disk
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
	// Name of the Disk to search for
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// If false, then disks having one of the statuses are not listed
	// Required: false
	ShowAll bool `url:"show_all,omitempty" json:"show_all,omitempty"`
}

SearchRequest struct for search

type ShareRequest

type ShareRequest struct {
	// ID of the disk to share
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
}

ShareRequest struct to share disk data

type SnapshotDeleteRequest

type SnapshotDeleteRequest struct {
	// ID of disk to delete
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// Label of the snapshot to delete
	// Required: true
	Label string `url:"label" json:"label" validate:"required"`
}

SnapshotDeleteRequest struct to delete snapshot

type SnapshotRollbackRequest

type SnapshotRollbackRequest struct {
	// ID of the disk
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

	// Label of the snapshot to rollback
	// Required: false
	Label string `url:"label,omitempty" json:"label,omitempty"`

	// Timestamp of the snapshot to rollback
	// Required: false
	TimeStamp uint64 `url:"timestamp,omitempty" json:"timestamp,omitempty"`
}

SnapshotRollbackRequest struct to rollback snapshot

type UnshareRequest

type UnshareRequest struct {
	// ID of the disk to unshare
	// Required: true
	DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
}

UnshareRequest struct to unshare data disk

Jump to

Keyboard shortcuts

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