v1.15.6
This commit is contained in:
@@ -482,9 +482,6 @@ type RecordCompute struct {
|
||||
// Natable VINS network name
|
||||
NatableVINSNetworkName string `json:"natableVinsNetworkName"`
|
||||
|
||||
// Node ID
|
||||
NodeID uint64 `json:"node_id"`
|
||||
|
||||
// Name of OS
|
||||
OSVersion string `json:"os_version"`
|
||||
|
||||
@@ -722,6 +719,9 @@ type SnapRecordCompute struct {
|
||||
// Network interface naming
|
||||
NetworkInterfaceNaming string `json:"networkInterfaceNaming"`
|
||||
|
||||
// Node ID
|
||||
NodeID uint64 `json:"node_id"`
|
||||
|
||||
// Numa Affinity
|
||||
NumaAffinity string `json:"numaAffinity"`
|
||||
|
||||
@@ -785,9 +785,6 @@ type SnapRecordCompute struct {
|
||||
// Resource group name
|
||||
RGName string `json:"rgName"`
|
||||
|
||||
// List snapsets
|
||||
SnapSets ListSnapSets `json:"snapSets"`
|
||||
|
||||
// Stateless SepID
|
||||
StatelessSepID int64 `json:"statelessSepId"`
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ type ListACL []ItemACL
|
||||
// Main information about snapshot
|
||||
type ItemSnapshot struct {
|
||||
// Compute info
|
||||
Compute RecordCompute `json:"compute"`
|
||||
Compute SnapRecordCompute `json:"compute"`
|
||||
|
||||
// List of disk IDs
|
||||
Disks []uint64 `json:"disks"`
|
||||
@@ -1239,6 +1239,270 @@ type RecordCompute struct {
|
||||
_ uint64 `json:"nodeId"`
|
||||
}
|
||||
|
||||
// SnapRecordCompute is RecordCompute but without the SnapSets field
|
||||
type SnapRecordCompute struct {
|
||||
// Account ID
|
||||
AccountID uint64 `json:"accountId"`
|
||||
|
||||
// Account name
|
||||
AccountName string `json:"accountName"`
|
||||
|
||||
// Access Control List
|
||||
ACL []interface{} `json:"acl"`
|
||||
|
||||
// Affinity label
|
||||
AffinityLabel string `json:"affinityLabel"`
|
||||
|
||||
// Affinity rules
|
||||
AffinityRules ListRules `json:"affinityRules"`
|
||||
|
||||
// Affinity weight
|
||||
AffinityWeight uint64 `json:"affinityWeight"`
|
||||
|
||||
// Anti affinity rules
|
||||
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
||||
|
||||
// Auto start when node restarted
|
||||
AutoStart bool `json:"autoStart"`
|
||||
|
||||
// Architecture
|
||||
Arch string `json:"arch"`
|
||||
|
||||
// Boot image ID
|
||||
BootImageID uint64 `json:"boot_image_id"`
|
||||
|
||||
// Boot order
|
||||
BootOrder []string `json:"bootOrder"`
|
||||
|
||||
// Boot type
|
||||
BootType string `json:"bootType"`
|
||||
|
||||
// Boot disk size
|
||||
BootDiskSize uint64 `json:"bootdiskSize"`
|
||||
|
||||
// CD Image Id
|
||||
CdImageId uint64 `json:"cdImageId"`
|
||||
|
||||
// Chipset
|
||||
Chipset string `json:"chipset"`
|
||||
|
||||
// Clone reference
|
||||
CloneReference uint64 `json:"cloneReference"`
|
||||
|
||||
// Clock
|
||||
Clock string `json:"clock"`
|
||||
|
||||
// List clone IDs
|
||||
Clones []uint64 `json:"clones"`
|
||||
|
||||
// Compute CI ID
|
||||
ComputeCIID uint64 `json:"computeciId"`
|
||||
|
||||
// CPU Pin
|
||||
CPUPin bool `json:"cpupin"`
|
||||
|
||||
// Number of CPU
|
||||
CPUs uint64 `json:"cpus"`
|
||||
|
||||
// Created by
|
||||
CreatedBy string `json:"createdBy"`
|
||||
|
||||
// Created time
|
||||
CreatedTime uint64 `json:"createdTime"`
|
||||
|
||||
// Custom fields
|
||||
CustomFields map[string]interface{} `json:"customFields"`
|
||||
|
||||
// Deleted by
|
||||
DeletedBy string `json:"deletedBy"`
|
||||
|
||||
// Deleted time
|
||||
DeletedTime uint64 `json:"deletedTime"`
|
||||
|
||||
// Description
|
||||
Description string `json:"desc"`
|
||||
|
||||
// Devices
|
||||
Devices interface{} `json:"devices"`
|
||||
|
||||
// List disks
|
||||
Disks ListDisks `json:"disks"`
|
||||
|
||||
// Driver
|
||||
Driver string `json:"driver"`
|
||||
|
||||
// Grid ID
|
||||
GID uint64 `json:"gid"`
|
||||
|
||||
// GUID
|
||||
GUID uint64 `json:"guid"`
|
||||
|
||||
// HPBacked
|
||||
HPBacked bool `json:"hpBacked"`
|
||||
|
||||
// Hot resize
|
||||
HotResize bool `json:"hotResize"`
|
||||
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
// Image ID
|
||||
ImageID uint64 `json:"imageId"`
|
||||
|
||||
// Image name
|
||||
ImageName string `json:"imageName"`
|
||||
|
||||
// List interfaces
|
||||
Interfaces ListInterfaces `json:"interfaces"`
|
||||
|
||||
// Loader meta iso information
|
||||
LoaderMetaIso LoaderMetaIso `json:"loaderMetaIso"`
|
||||
|
||||
// Live migration job ID
|
||||
LiveMigrationJobID uint64 `json:"live_migration_job_id"`
|
||||
|
||||
// Loader type
|
||||
LoaderType string `json:"loaderType"`
|
||||
|
||||
// Lock status
|
||||
LockStatus string `json:"lockStatus"`
|
||||
|
||||
// Manager ID
|
||||
ManagerID uint64 `json:"managerId"`
|
||||
|
||||
// Manager type
|
||||
ManagerType string `json:"managerType"`
|
||||
|
||||
// Migration job
|
||||
MigrationJob uint64 `json:"migrationjob"`
|
||||
|
||||
// Milestones
|
||||
Milestones uint64 `json:"milestones"`
|
||||
|
||||
// Name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Natable VINS ID
|
||||
NatableVINSID uint64 `json:"natableVinsId"`
|
||||
|
||||
// Natable VINS IP
|
||||
NatableVINSIP string `json:"natableVinsIp"`
|
||||
|
||||
// Natable VINS Name
|
||||
NatableVINSName string `json:"natableVinsName"`
|
||||
|
||||
// Natable VINS network
|
||||
NatableVINSNetwork string `json:"natableVinsNetwork"`
|
||||
|
||||
// Natable VINS network name
|
||||
NatableVINSNetworkName string `json:"natableVinsNetworkName"`
|
||||
|
||||
// Need reboot
|
||||
NeedReboot bool `json:"needReboot"`
|
||||
|
||||
// network interface naming
|
||||
NetworkInterfaceNaming string `json:"networkInterfaceNaming"`
|
||||
|
||||
// NumaAffinity
|
||||
NumaAffinity string `json:"numaAffinity"`
|
||||
|
||||
//NumaNodeId
|
||||
NumaNodeId int64 `json:"numaNodeId"`
|
||||
|
||||
// List OS users
|
||||
OSUsers ListOSUsers `json:"osUsers"`
|
||||
|
||||
// Name of OS
|
||||
OSVersion string `json:"os_version"`
|
||||
|
||||
// Pinned to node
|
||||
PinnedToNode int64 `json:"pinnedToNode"`
|
||||
|
||||
// PreferredCPU
|
||||
PreferredCPU []int64 `json:"preferredCpu"`
|
||||
|
||||
// CPU alignment profile
|
||||
CPUAlignmentProfile CPUAlignmentProfile `json:"cpu_alignment_profile"`
|
||||
|
||||
// Qemu_quest
|
||||
QemuQuest QemuQuest `json:"qemu_guest"`
|
||||
|
||||
// ReadOnly indicates read-only mode state
|
||||
ReadOnly bool `json:"read_only"`
|
||||
|
||||
// Number of RAM
|
||||
RAM uint64 `json:"ram"`
|
||||
|
||||
// Reference ID
|
||||
ReferenceID string `json:"referenceId"`
|
||||
|
||||
// Registered
|
||||
Registered bool `json:"registered"`
|
||||
|
||||
// Whether a compute has been resized online
|
||||
ResizedOnline bool `json:"resizedOnline"`
|
||||
|
||||
// Resource name
|
||||
ResName string `json:"resName"`
|
||||
|
||||
// Reserved Node Cpus
|
||||
ReservedNodeCpus []uint64 `json:"reservedNodeCpus"`
|
||||
|
||||
// Resource group ID
|
||||
RGID uint64 `json:"rgId"`
|
||||
|
||||
// Resource group name
|
||||
RGName string `json:"rgName"`
|
||||
|
||||
// Node ID
|
||||
NodeID uint64 `json:"node_id"`
|
||||
|
||||
// Node name
|
||||
NodeName string `json:"nodeName"`
|
||||
|
||||
// Stateless SEP ID
|
||||
StatelessSEPID int64 `json:"statelessSepId"`
|
||||
|
||||
// Stateless SEP Type
|
||||
StatelessSEPType string `json:"statelessSepType"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Tags
|
||||
Tags map[string]interface{} `json:"tags"`
|
||||
|
||||
// Tech status
|
||||
TechStatus string `json:"techStatus"`
|
||||
|
||||
// Total disk size
|
||||
TotalDiskSize uint64 `json:"totalDisksSize"`
|
||||
|
||||
// Updated by
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
|
||||
// Updated time
|
||||
UpdatedTime uint64 `json:"updatedTime"`
|
||||
|
||||
// User managed
|
||||
UserManaged bool `json:"userManaged"`
|
||||
|
||||
// Userdata
|
||||
Userdata interface{} `json:"userdata"`
|
||||
|
||||
// List VGPU
|
||||
VGPUs []VGPUItem `json:"vgpus"`
|
||||
|
||||
// VNC password
|
||||
VNCPassword string `json:"vncPasswd"`
|
||||
|
||||
// Weight
|
||||
Weight uint64 `json:"weight"`
|
||||
|
||||
// Zone ID
|
||||
ZoneID uint64 `json:"zoneId"`
|
||||
}
|
||||
|
||||
type LoaderMetaIso struct {
|
||||
// Name
|
||||
DeviceName string `json:"devicename"`
|
||||
|
||||
@@ -2,8 +2,8 @@ package sep
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
@@ -20,23 +20,24 @@ type AddConsumerNodesRequest struct {
|
||||
}
|
||||
|
||||
// AddConsumerNodes adds consumer nodes to SEP parameters
|
||||
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (uint64, error) {
|
||||
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) ([]uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
list := []uint64{}
|
||||
if err != nil {
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
return list, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/sep/addConsumerNodes"
|
||||
|
||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return list, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseUint(string(res), 10, 64)
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return list, nil
|
||||
}
|
||||
|
||||
@@ -181,55 +181,39 @@ type L2ExternalNetwork struct {
|
||||
VLANTag *int `json:"vlan_tag"`
|
||||
}
|
||||
|
||||
type ExternalNetworkPorts []ExternalNetworkPort
|
||||
|
||||
// Info about an external network port
|
||||
type ExternalNetworkPorts struct {
|
||||
type ExternalNetworkPort struct {
|
||||
// Access group ID
|
||||
AccessGroupID string `json:"access_group_id"`
|
||||
|
||||
// Access group name
|
||||
AccessGroupName string `json:"access_group_name"`
|
||||
|
||||
// Bridge network name
|
||||
BridgeNetworkName string `json:"bridge_network_name"`
|
||||
// Comment
|
||||
Comment string `json:"comment"`
|
||||
|
||||
// Default gateway for IPv4
|
||||
DefaultGatewayIPv4 string `json:"default_gateway_ipv4"`
|
||||
// The name displayed
|
||||
DisplayName string `json:"display_name"`
|
||||
|
||||
// Default gateway for IPv6
|
||||
DefaultGatewayIPv6 string `json:"default_gateway_ipv6"`
|
||||
// Whether the port is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Description
|
||||
Description string `json:"description"`
|
||||
|
||||
// Details of external network ports
|
||||
ExternalNetworkPorts ExternalNetworkPortsField `json:"external_network_ports"`
|
||||
|
||||
// Hypervisors
|
||||
Hypervisors []string `json:"hypervisors"`
|
||||
// The ID of the external network
|
||||
ExternalNetworkID string `json:"external_network_id"`
|
||||
|
||||
// ID of an external network port
|
||||
ID string `json:"id"`
|
||||
|
||||
// Status
|
||||
Status Status `json:"status"`
|
||||
// IP of version 4
|
||||
IPv4 string `json:"ipv4"`
|
||||
|
||||
// Version ID
|
||||
VersionID uint64 `json:"version_id"`
|
||||
|
||||
// Subnet for V4
|
||||
SubnetV4 string `json:"subnet_v4"`
|
||||
|
||||
// Subnet for V6
|
||||
SubnetV6 string `json:"subnet_v6"`
|
||||
|
||||
// Created at
|
||||
CreatedAt string `json:"created_at"`
|
||||
|
||||
// Updated at
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
|
||||
// VLAN Tag
|
||||
VLANTag int `json:"vlan_tag"`
|
||||
// MAC
|
||||
MAC string `json:"mac"`
|
||||
}
|
||||
|
||||
// Info about a logical port
|
||||
|
||||
Reference in New Issue
Block a user