This commit is contained in:
stSolo
2023-03-01 19:05:53 +03:00
parent de12bc2acc
commit 42800ac4fe
573 changed files with 2077 additions and 1844 deletions

View File

@@ -13,46 +13,46 @@ import (
type CreateRequest struct {
// ID of the account
// Required: true
AccountID uint64 `url:"accountId"`
AccountID uint64 `url:"accountId" json:"accountId"`
// ID of the grid (platform)
// Required: true
GID uint64 `url:"gid"`
GID uint64 `url:"gid" json:"gid"`
// Name of disk
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
// Description of disk
// Required: false
Description string `url:"description,omitempty"`
Description string `url:"description,omitempty" json:"description,omitempty"`
// Size in GB, default is 0
// Required: false
Size uint64 `url:"size,omitempty"`
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
// Type of disk
// - B=Boot
// - D=Data
// - T=Temp
// Required: true
Type string `url:"type"`
Type string `url:"type" json:"type"`
// Size in GB default is 0
// Required: false
SSDSize uint64 `url:"ssdSize,omitempty"`
SSDSize uint64 `url:"ssdSize,omitempty" json:"ssdSize,omitempty"`
// Max IOPS disk can perform defaults to 2000
// Required: false
IOPS uint64 `url:"iops,omitempty"`
IOPS uint64 `url:"iops,omitempty" json:"iops,omitempty"`
// Storage endpoint provider ID to create disk
// Required: false
SEPID uint64 `url:"sep_id,omitempty"`
SEPID uint64 `url:"sep_id,omitempty" json:"sep_id,omitempty"`
// Pool name to create disk
// Required: false
Pool string `url:"pool,omitempty"`
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
}
func (drq CreateRequest) validate() error {

View File

@@ -11,19 +11,19 @@ import (
type DeleteRequest struct {
// ID of disk to delete
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// Detach disk from machine first
// Required: false
Detach bool `url:"detach,omitempty"`
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"`
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
// Reason to delete
// Required: false
Reason string `url:"reason,omitempty"`
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
func (d DeleteRequest) validate() error {

View File

@@ -11,15 +11,15 @@ import (
type DisksDeleteRequest struct {
// List of disk ids to delete
// Required: true
DisksIDs []uint64 `url:"diskIds"`
DisksIDs []uint64 `url:"diskIds" json:"diskIds"`
// Reason for deleting the disks
// Required: true
Reason string `url:"reason"`
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"`
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}
func (drq DisksDeleteRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type GetRequest struct {
// ID of the disk
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
}
func (drq GetRequest) validate() error {

View File

@@ -11,63 +11,63 @@ import (
type LimitIORequest struct {
// ID of the disk to limit
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// Alias for total_iops_sec for backwards compatibility
// Required: false
IOPS uint64 `url:"iops,omitempty"`
IOPS uint64 `url:"iops,omitempty" json:"iops,omitempty"`
// TotalBytesSec
// Required: false
TotalBytesSec uint64 `url:"total_bytes_sec,omitempty"`
TotalBytesSec uint64 `url:"total_bytes_sec,omitempty" json:"total_bytes_sec,omitempty"`
// ReadBytesSec
// Required: false
ReadBytesSec uint64 `url:"read_bytes_sec,omitempty"`
ReadBytesSec uint64 `url:"read_bytes_sec,omitempty" json:"read_bytes_sec,omitempty"`
// WriteBytesSec
// Required: false
WriteBytesSec uint64 `url:"write_bytes_sec,omitempty"`
WriteBytesSec uint64 `url:"write_bytes_sec,omitempty" json:"write_bytes_sec,omitempty"`
// TotalIOPSSec
// Required: false
TotalIOPSSec uint64 `url:"total_iops_sec,omitempty"`
TotalIOPSSec uint64 `url:"total_iops_sec,omitempty" json:"total_iops_sec,omitempty"`
// ReadIOPSSec
// Required: false
ReadIOPSSec uint64 `url:"read_iops_sec,omitempty"`
ReadIOPSSec uint64 `url:"read_iops_sec,omitempty" json:"read_iops_sec,omitempty"`
// WriteIOPSSec
// Required: false
WriteIOPSSec uint64 `url:"write_iops_sec,omitempty"`
WriteIOPSSec uint64 `url:"write_iops_sec,omitempty" json:"write_iops_sec,omitempty"`
// TotalBytesSecMax
// Required: false
TotalBytesSecMax uint64 `url:"total_bytes_sec_max,omitempty"`
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"`
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"`
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"`
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"`
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"`
WriteIOPSSecMax uint64 `url:"write_iops_sec_max,omitempty" json:"write_iops_sec_max,omitempty"`
// SizeIOPSSec
// Required: false
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty"`
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
}
func (drq LimitIORequest) validate() error {

View File

@@ -10,19 +10,19 @@ import (
type ListRequest struct {
// ID of the account the disks belong to
// Required: false
AccountID uint64 `url:"accountId,omitempty"`
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty"`
Type string `url:"type,omitempty" json:"type,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty"`
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty"`
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// List gets list the created disks belonging to an account

View File

@@ -10,7 +10,7 @@ import (
type ListTypesRequest struct {
// Show detailed disk types by seps
// Required: false
Detailed bool `url:"detailed"`
Detailed bool `url:"detailed" json:"detailed"`
}
// ListTypes gets list defined disk types

View File

@@ -10,7 +10,7 @@ import (
type ListUnattachedRequest struct {
// ID of the account
// Required: false
AccountID uint64 `url:"accountId,omitempty"`
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
}
// ListUnattached gets list of unattached disks

View File

@@ -11,11 +11,11 @@ import (
type RenameRequest struct {
// ID of the disk to rename
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// New name of disk
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
}
func (drq RenameRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type ResizeRequest struct {
// ID of the disk to resize
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// New size of the disk in GB
// Required: true
Size uint64 `url:"size"`
Size uint64 `url:"size" json:"size"`
}
func (drq ResizeRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type RestoreRequest struct {
// ID of the disk to restore
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// Reason for restoring the disk
// Required: true
Reason string `url:"reason"`
Reason string `url:"reason" json:"reason"`
}
func (drq RestoreRequest) validate() error {

View File

@@ -10,14 +10,14 @@ import (
type SearchRequest struct {
// ID of the account to search for the Disk
// Required: false
AccountID uint64 `url:"accountId,omitempty"`
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Name of the Disk to search for
// Required: false
Name string `url:"name,omitempty"`
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"`
ShowAll bool `url:"show_all,omitempty" json:"show_all,omitempty"`
}
// Search search disks

View File

@@ -11,7 +11,7 @@ import (
type ShareRequest struct {
// ID of the disk to share
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
}
func (drq ShareRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type SnapshotDeleteRequest struct {
// ID of disk to delete
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// Label of the snapshot to delete
// Required: false
Label string `url:"label"`
Label string `url:"label" json:"label"`
}
func (drq SnapshotDeleteRequest) validate() error {

View File

@@ -11,15 +11,15 @@ import (
type SnapshotRollbackRequest struct {
// ID of the disk
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
// Label of the snapshot to rollback
// Required: true
Label string `url:"label"`
Label string `url:"label" json:"label"`
// Timestamp of the snapshot to rollback
// Required: true
TimeStamp uint64 `url:"timestamp"`
TimeStamp uint64 `url:"timestamp" json:"timestamp"`
}
func (drq SnapshotRollbackRequest) validate() error {

View File

@@ -11,7 +11,7 @@ import (
type UnshareRequest struct {
// ID of the disk to unshare
// Required: true
DiskID uint64 `url:"diskId"`
DiskID uint64 `url:"diskId" json:"diskId"`
}
func (drq UnshareRequest) validate() error {