Documentation
¶
Overview ¶
API Actor api, this actor is the final api a enduser uses to manage his resources
Index ¶
- type CreateRequest
- type DeleteRequest
- type Disks
- func (d Disks) Create(ctx context.Context, req CreateRequest) (uint64, error)
- func (d Disks) Delete(ctx context.Context, req DeleteRequest) (bool, error)
- func (d Disks) DeleteDisks(ctx context.Context, req DisksDeleteRequest) (bool, error)
- func (d Disks) Get(ctx context.Context, req GetRequest) (*RecordDisk, error)
- func (d Disks) LimitIO(ctx context.Context, req LimitIORequest) (bool, error)
- func (d Disks) List(ctx context.Context, req ListRequest) (ListDisks, error)
- func (d Disks) ListDeleted(ctx context.Context, req ListRequest) (ListDisks, error)
- func (d Disks) ListTypes(ctx context.Context, req ListTypesRequest) ([]interface{}, error)
- func (d Disks) ListUnattached(ctx context.Context, req ListUnattachedRequest) (ListDisks, error)
- func (d Disks) Rename(ctx context.Context, req RenameRequest) (bool, error)
- func (d Disks) Resize(ctx context.Context, req ResizeRequest) (bool, error)
- func (d Disks) Resize2(ctx context.Context, req ResizeRequest) (bool, error)
- func (d Disks) Restore(ctx context.Context, req RestoreRequest) (bool, error)
- func (d Disks) Search(ctx context.Context, req SearchRequest) (ListDisks, error)
- func (d Disks) Share(ctx context.Context, req ShareRequest) (bool, error)
- func (d Disks) SnapshotDelete(ctx context.Context, req SnapshotDeleteRequest) (bool, error)
- func (d Disks) SnapshotRollback(ctx context.Context, req SnapshotRollbackRequest) (bool, error)
- func (d Disks) Unshare(ctx context.Context, req UnshareRequest) (bool, error)
- type DisksDeleteRequest
- type GetRequest
- type IOTune
- type ItemDisk
- type ItemSnapshot
- type LimitIORequest
- type ListDisks
- type ListRequest
- type ListSnapshots
- type ListTypesRequest
- type ListUnattachedRequest
- type RecordDisk
- type RenameRequest
- type ResizeRequest
- type RestoreRequest
- type SearchRequest
- type ShareRequest
- type SnapshotDeleteRequest
- type SnapshotRollbackRequest
- type UnshareRequest
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"`
// ID of the grid (platform)
// Required: true
GID uint64 `url:"gid" json:"gid"`
// Name of disk
// Required: true
Name string `url:"name" json:"name"`
// 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"`
// 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"`
}
Request struct for create disk
type DeleteRequest ¶
type DeleteRequest struct {
// ID of disk to delete
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
// 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"`
}
Request for delete disk
type Disks ¶
type Disks struct {
// contains filtered or unexported fields
}
Structure for creating request to disks
func (Disks) DeleteDisks ¶
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 ¶
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) ListDeleted ¶
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 ¶
ListUnattached gets list of unattached disks
func (Disks) Resize ¶
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 ¶
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) SnapshotDelete ¶
SnapshotDelete deletes a snapshot
func (Disks) SnapshotRollback ¶
SnapshotRollback rollback an individual disk snapshot
type DisksDeleteRequest ¶
type DisksDeleteRequest struct {
// List of disk ids to delete
// Required: true
DisksIDs []uint64 `url:"diskIds" json:"diskIds"`
// Reason for deleting the disks
// Required: true
Reason string `url:"reason" json:"reason"`
// Whether to completely delete the disks, works only with non attached disks
// Required: false
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}
Request struct for multiple disks
type GetRequest ¶
type GetRequest struct {
// ID of the disk
// Required: true
DiskID uint64 `url:"diskId" json:"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"`
// 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 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
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" json:"diskId"`
// 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"`
}
Request struct for limit IO
type ListRequest ¶
type ListRequest struct {
// 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"`
}
Request struct for get list/list_deleted of disks
type ListTypesRequest ¶
type ListTypesRequest struct {
// Show detailed disk types by seps
// Required: false
Detailed bool `url:"detailed" json:"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" json:"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"`
// 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 uint64 `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 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"`
// New name of disk
// Required: true
Name string `url:"name" json:"name"`
}
Request struct for rename disk
type ResizeRequest ¶
type ResizeRequest struct {
// ID of the disk to resize
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
// New size of the disk in GB
// Required: true
Size uint64 `url:"size" json:"size"`
}
Request struct for resize disk
type RestoreRequest ¶
type RestoreRequest struct {
// ID of the disk to restore
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
// Reason for restoring the disk
// Required: true
Reason string `url:"reason" json:"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" 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"`
}
Request struct for search
type ShareRequest ¶ added in v1.1.0
type ShareRequest struct {
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
}
Request struct for share data disk
type SnapshotDeleteRequest ¶
type SnapshotDeleteRequest struct {
// ID of disk to delete
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
// Label of the snapshot to delete
// Required: false
Label string `url:"label" json:"label"`
}
Request struct for delete snapshot
type SnapshotRollbackRequest ¶
type SnapshotRollbackRequest struct {
// ID of the disk
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
// Label of the snapshot to rollback
// Required: true
Label string `url:"label" json:"label"`
// Timestamp of the snapshot to rollback
// Required: true
TimeStamp uint64 `url:"timestamp" json:"timestamp"`
}
Request struct for rollback snapshot
type UnshareRequest ¶ added in v1.1.0
type UnshareRequest struct {
// Required: true
DiskID uint64 `url:"diskId" json:"diskId"`
}
Request struct for unshare data disk