v1.5.0-gamma

This commit is contained in:
2023-06-30 11:21:47 +03:00
parent 29c7f143fe
commit f50f71ab0d
98 changed files with 2369 additions and 1150 deletions

View File

@@ -8,6 +8,23 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
type Interface struct {
// Network type
// Should be one of:
// - VINS
// - EXTNET
NetType string `url:"netType" json:"netType" validate:"required,kvmNetType"`
// Network ID for connect to,
// for EXTNET - external network ID,
// for VINS - VINS ID,
NetID uint64 `url:"netId" json:"netId" validate:"required"`
// IP address to assign to this VM when connecting to the specified network
// Required: false
IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"`
}
// Request struct for create KVM x86 VM
type CreateRequest struct {
// ID of the resource group, which will own this VM
@@ -45,24 +62,8 @@ type CreateRequest struct {
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Network type
// Should be one of:
// - VINS
// - EXTNET
// - NONE
// Required: false
NetType string `url:"netType,omitempty" json:"netType,omitempty" validate:"omitempty,kvmNetType"`
// Network ID for connect to,
// for EXTNET - external network ID,
// for VINS - VINS ID,
// when network type is not "NONE"
// Required: false
NetID uint64 `url:"netId,omitempty" json:"netId,omitempty"`
// IP address to assign to this VM when connecting to the specified network
// Required: false
IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"`
// Slice of structs with net interface description.
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
// Input data for cloud-init facility
// Required: false

View File

@@ -40,25 +40,8 @@ type CreateBlankRequest struct {
// Required: true
Pool string `url:"pool" json:"pool" validate:"required"`
// Network type
// Should be one of:
// - VINS
// - EXTNET
// - NONE
// Required: false
NetType string `url:"netType,omitempty" json:"netType,omitempty" validate:"omitempty,kvmNetType"`
// Network ID for connect to,
// for EXTNET - external network ID,
// for VINS - VINS ID,
// when network type is not "NONE"
// Required: false
NetID uint64 `url:"netId,omitempty" json:"netId,omitempty"`
// IP address to assign to this VM when connecting to the specified network
// Required: false
IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"`
// Slice of structs with net interface description.
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
// Text description of this VM
// Required: false
Description string `url:"desc,omitempty" json:"desc,omitempty"`