v1.5.0-delta

This commit is contained in:
Никита Сорокин
2023-07-13 15:28:07 +03:00
parent 7c787f6fce
commit 5025a17ea4
71 changed files with 1602 additions and 936 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,9 @@ type CreateRequest struct {
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Network type
// Should be one of:
// - VINS
// - EXTNET
// - NONE
// Slice of structs with net interface description.
// 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"`
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
// Input data for cloud-init facility
// Required: false
@@ -88,6 +90,10 @@ type CreateRequest struct {
// Required: false
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
// Custom fields for Compute. Must be dict
// Required: false
CustomField string `url:"customFields,omitempty" json:"customFields,omitempty"`
// Reason for action
// Required: false
Reason string `url:"reason,omitempty" json:"reason,omitempty"`

View File

@@ -40,24 +40,9 @@ type CreateBlankRequest struct {
// Required: true
Pool string `url:"pool" json:"pool" validate:"required"`
// Network type
// Should be one of:
// - VINS
// - EXTNET
// - NONE
// Slice of structs with net interface description.
// 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"`
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
// Text description of this VM
// Required: false

View File

@@ -48,24 +48,9 @@ type MassCreateRequest struct {
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Network type
// Should be one of:
// - VINS
// - EXTNET
// - NONE
// Slice of structs with net interface description.
// 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"`
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
// Input data for cloud-init facility
// Required: false