This commit is contained in:
2025-04-09 11:21:07 +03:00
parent 3f21a89e80
commit 8a101c6fcb
115 changed files with 2342 additions and 429 deletions

View File

@@ -14,10 +14,6 @@ type CreateRequest struct {
// 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"`
@@ -30,17 +26,6 @@ type CreateRequest struct {
// 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"`

View File

@@ -21,6 +21,10 @@ type DeleteRequest struct {
// Whether to completely delete the disk, works only with non attached disks
// Required: false
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
// Name of disk to delete
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
}
// Delete deletes disk by ID

View File

@@ -41,9 +41,9 @@ var disks = ListDisks{
Password: "",
PCISlot: 6,
Pool: "vmstor",
PresentTo: []uint64{
27,
},
//PresentTo: []uint64{
// 27,
//},
PurgeAttempts: 0,
PurgeTime: 0,
RealityDeviceNumber: 0,
@@ -100,10 +100,10 @@ var disks = ListDisks{
Password: "",
PCISlot: 6,
Pool: "vmstor",
PresentTo: []uint64{
27,
27,
},
//PresentTo: []uint64{
// 27,
// 27,
//},
PurgeAttempts: 0,
PurgeTime: 0,
RealityDeviceNumber: 0,

View File

@@ -123,7 +123,7 @@ type InfoDisk struct {
Pool string `json:"pool"`
// Present to
PresentTo []uint64 `json:"presentTo"`
PresentTo map[string]uint64 `json:"presentTo"`
// Purge attempts
PurgeAttempts uint64 `json:"purgeAttempts"`
@@ -155,6 +155,9 @@ type InfoDisk struct {
// Shareable
Shareable bool `json:"shareable"`
// Size available
SizeAvailable uint64 `json:"sizeAvailable"`
// Size max
SizeMax int64 `json:"sizeMax"`
@@ -175,6 +178,9 @@ type InfoDisk struct {
// Virtual machine ID
VMID uint64 `json:"vmid"`
// Updated by
UpdatedBy string `json:"updatedBy"`
}
type ItemReplication struct {
@@ -199,24 +205,38 @@ type ItemReplication struct {
// Detailed indormation about disk
type RecordDisk struct {
//Created by
CreatedBy string `json:"createdBy"`
//Deleted by
DeletedBy string `json:"deletedBy"`
// Device name
DeviceName string `json:"devicename"`
// SEP type
SEPType string `json:"sepType"`
// Main information about disk
InfoDisk
}
// Main information for list disks
type ItemDisk struct {
// Machine ID
MachineID uint64 `json:"machineId"`
// Machine name
MachineName string `json:"machineName"`
// Main information about disk
InfoDisk
//Updated by
UpdatedBy string `json:"updatedBy"`
// Update time
UpdatedTime uint64 `json:"updatedTime"`
}
// Main information for list disks
type ItemDisk struct {
// Detailed information about disk
RecordDisk
}