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,19 +13,19 @@ import (
type CreateRequest struct {
// Name of the rescue disk
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
// URL where to download media from
// Required: true
URL string `url:"url"`
URL string `url:"url" json:"url"`
// Grid (platform) ID where this template should be create in
// Required: true
GID uint64 `url:"gid"`
GID uint64 `url:"gid" json:"gid"`
// Boot type of image bios or UEFI
// Required: true
BootType string `url:"boottype"`
BootType string `url:"boottype" json:"boottype"`
// Image type
// Should be:
@@ -33,51 +33,51 @@ type CreateRequest struct {
// - windows
// - or other
// Required: true
ImageType string `url:"imagetype"`
ImageType string `url:"imagetype" json:"imagetype"`
// Does this machine supports hot resize
// Required: false
HotResize bool `url:"hotresize,omitempty"`
HotResize bool `url:"hotresize,omitempty" json:"hotresize,omitempty"`
// Optional username for the image
// Required: false
Username string `url:"username,omitempty"`
Username string `url:"username,omitempty" json:"username,omitempty"`
// Optional password for the image
// Required: false
Password string `url:"password,omitempty"`
Password string `url:"password,omitempty" json:"password,omitempty"`
// Account ID to make the image exclusive
// Required: false
AccountID uint64 `url:"accountId,omitempty"`
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Username for upload binary media
// Required: false
UsernameDL string `url:"usernameDL,omitempty"`
UsernameDL string `url:"usernameDL,omitempty" json:"usernameDL,omitempty"`
// Password for upload binary media
// Required: false
PasswordDL string `url:"passwordDL,omitempty"`
PasswordDL string `url:"passwordDL,omitempty" json:"passwordDL,omitempty"`
// Storage endpoint provider ID
// Required: false
SEPID uint64 `url:"sepId,omitempty"`
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
// Pool for image create
// Required: false
Pool string `url:"poolName,omitempty"`
Pool string `url:"poolName,omitempty" json:"poolName,omitempty"`
// Binary architecture of this image
// Should be:
// - X86_64
// - PPC64_LE
// Required: false
Architecture string `url:"architecture,omitempty"`
Architecture string `url:"architecture,omitempty" json:"architecture,omitempty"`
// List of types of compute suitable for image
// Example: [ "KVM_X86" ]
// Required: true
Drivers []string `url:"drivers"`
Drivers []string `url:"drivers" json:"drivers"`
}
func (irq CreateRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type CreateVirtualRequest struct {
// Name of the virtual image to create
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
// ID of real image to link this virtual image to upon creation
// Required: true
TargetID uint64 `url:"targetId"`
TargetID uint64 `url:"targetId" json:"targetId"`
}
func (irq CreateVirtualRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type DeleteRequest struct {
// ID of the image to delete
// Required: true
ImageID uint64 `url:"imageId"`
ImageID uint64 `url:"imageId" json:"imageId"`
// Whether to completely delete the image
// Required: false
Permanently bool `url:"permanently,omitempty"`
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
}
func (irq DeleteRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type GetRequest struct {
// ID of image to get
// Required: true
ImageID uint64 `url:"imageId"`
ImageID uint64 `url:"imageId" json:"imageId"`
// If set to False returns only images in status CREATED
// Required: false
ShowAll bool `url:"show_all,omitempty"`
ShowAll bool `url:"show_all,omitempty" json:"show_all,omitempty"`
}
func (irq GetRequest) validate() error {

View File

@@ -11,11 +11,11 @@ import (
type LinkRequest struct {
// ID of the virtual image
// Required: true
ImageID uint64 `url:"imageId"`
ImageID uint64 `url:"imageId" json:"imageId"`
// ID of real image to link this virtual image to
// Required: true
TargetID uint64 `url:"targetId"`
TargetID uint64 `url:"targetId" json:"targetId"`
}
func (irq LinkRequest) validate() error {

View File

@@ -10,15 +10,15 @@ import (
type ListRequest struct {
// Optional account ID to include account images
// Required: false
AccountID uint64 `json:"accountId,omitempty"`
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Page number
// Required: false
Page uint64 `json:"page,omitempty"`
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `json:"size,omitempty"`
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// List gets list available images, optionally filtering by account ID

View File

@@ -11,11 +11,11 @@ import (
type RenameRequest struct {
// ID of the virtual image to rename
// Required: true
ImageID uint64 `url:"imageId"`
ImageID uint64 `url:"imageId" json:"imageId"`
// New name
// Required: true
Name string `url:"name"`
Name string `url:"name" json:"name"`
}
func (irq RenameRequest) validate() error {