disks

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 7 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"`

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

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

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

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

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

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

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

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

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

Request struct for create disk

type DeleteRequest

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

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

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

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

Request for 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 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 the created disks belonging to an account

func (Disks) ListDeleted

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

ListDeleted gets list the deleted disks belonging to an account

func (Disks) ListTypes

func (d Disks) ListTypes(ctx context.Context, req ListTypesRequest) ([]interface{}, error)

ListTypes gets list defined disk types

func (Disks) ListUnattached

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

ListUnattached gets list of unattached disks

func (Disks) Rename

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

Rename rename disk

func (Disks) Resize

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

Resize 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 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 restore a deleted unattached disk from recycle bin

func (Disks) Search

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

Search search disks

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 rollback an individual disk snapshot

type DisksDeleteRequest

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

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

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

Request struct for multiple disks

type GetRequest

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

Request struct for 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"`

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

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

	// Compute ID
	ComputeID uint64 `json:"computeId"`

	// Compute name
	ComputeName string `json:"computeName"`

	// 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 uint64 `json:"pciSlot"`

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

	// 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"`

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

	// 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

type ItemSnapshot

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

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

	// 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"`

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Request struct for limit IO

type ListDisks

type ListDisks []ItemDisk

List of disks

type ListRequest

type ListRequest struct {
	// ID of the account the disks belong to
	// Required: false
	AccountID uint64 `url:"accountId,omitempty"`

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

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

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

Request struct for get list/list_deleted of disks

type ListSnapshots

type ListSnapshots []ItemSnapshot

List of snapshots

type ListTypesRequest

type ListTypesRequest struct {
	// Show detailed disk types by seps
	// Required: false
	Detailed bool `url:"detailed"`
}

Request struct for get list types of disks

type ListUnattachedRequest

type ListUnattachedRequest struct {
	// ID of the account
	// Required: false
	AccountID uint64 `url:"accountId,omitempty"`
}

Request struct for get list 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"`

	// 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 uint64 `json:"pciSlot"`

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

	// 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"`

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

	// Size used
	SizeUsed uint64 `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"`

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

Request struct for rename disk

type ResizeRequest

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

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

Request struct for resize disk

type RestoreRequest

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

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

Request struct for 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"`
	// Name of the Disk to search for
	// Required: false
	Name string `url:"name,omitempty"`

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

Request struct for search

type SnapshotDeleteRequest

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

	// Label of the snapshot to delete
	// Required: false
	Label string `url:"label"`
}

Request struct for delete snapshot

type SnapshotRollbackRequest

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

	// Label of the snapshot to rollback
	// Required: true
	Label string `url:"label"`

	// Timestamp of the snapshot to rollback
	// Required: true
	TimeStamp uint64 `url:"timestamp"`
}

Request struct for rollback snapshot

Jump to

Keyboard shortcuts

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