Files
decort-golang-sdk/pkg/cloudapi/rg/models.go

855 lines
15 KiB
Go
Raw Normal View History

2022-08-11 08:09:54 +00:00
package rg
2023-01-23 15:39:41 +03:00
// Resources used
type Resource struct {
// Number of cores
CPU int64 `json:"cpu"`
// Disk size
2023-03-01 11:44:08 +03:00
DiskSize float64 `json:"disksize"`
2023-01-23 15:39:41 +03:00
// Max disk size
2023-06-30 11:21:47 +03:00
DiskSizeMax float64 `json:"disksizemax"`
2023-01-23 15:39:41 +03:00
// Number of External IPs
ExtIPs int64 `json:"extips"`
// Number of grafic cores
GPU int64 `json:"gpu"`
// Number of RAM
RAM int64 `json:"ram"`
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
// Disk usage
type DiskUsage struct {
// Disk size
DiskSize float64 `json:"disksize"`
// Disk size max
2023-06-30 11:21:47 +03:00
DiskSizeMax float64 `json:"disksizemax"`
2023-01-23 15:39:41 +03:00
}
// Information about resources
type Resources struct {
// Current information about resources
Current Resource `json:"Current"`
// Reserved information about resources
Reserved Resource `json:"Reserved"`
}
2023-06-30 11:21:47 +03:00
// Detailed information about resource consumption
type ItemResourceConsumption struct {
// Consumed information about resources
2023-10-03 16:44:32 +03:00
Consumed Resource `json:"consumed"`
2023-06-30 11:21:47 +03:00
// Reserved information about resources
2023-10-03 16:44:32 +03:00
Reserved Resource `json:"reserved"`
2023-06-30 11:21:47 +03:00
2023-07-21 15:14:10 +03:00
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
2023-06-30 11:21:47 +03:00
// Resource group ID
RGID uint64 `json:"rgid"`
}
type ListResourceConsumption struct {
Data []ItemResourceConsumption `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Detailed information about resource group
type RecordResourceGroup struct {
2023-01-23 15:39:41 +03:00
// Account ID
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// Access Control List
ACL ListACL `json:"acl"`
2024-04-16 14:26:06 +03:00
// Compute Features
ComputeFeatures []string `json:"computeFeatures"`
2023-04-28 11:46:58 +03:00
// CPU allocation parameter
CPUAllocationParameter string `json:"cpu_allocation_parameter"`
// CPU allocation ratio
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
2023-01-23 15:39:41 +03:00
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// DefNetID
DefNetID int64 `json:"def_net_id"`
// DefNetType
DefNetType string `json:"def_net_type"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
// Description
Description string `json:"desc"`
// Dirty
Dirty bool `json:"dirty"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// Lock status
LockStatus string `json:"lockStatus"`
// Milestones
Milestones uint64 `json:"milestones"`
// Name
Name string `json:"name"`
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
2023-04-28 11:46:58 +03:00
// List of resource types
ResTypes []string `json:"resourceTypes"`
2025-08-29 12:51:25 +03:00
// Storage policy ids
StoragePolicyIDs []uint64 `json:"storage_policy_ids"`
2025-07-15 17:39:18 +03:00
// SDN access group id
SDNAccessGroupID string `json:"sdn_access_group_id"`
2023-01-23 15:39:41 +03:00
// Secret
Secret string `json:"secret"`
// Status
Status string `json:"status"`
2023-04-28 11:46:58 +03:00
// UniqPools
UniqPools []string `json:"uniqPools"`
2023-01-23 15:39:41 +03:00
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// List of VINS IDs
VINS []uint64 `json:"vins"`
// List of compute IDs
Computes []uint64 `json:"vms"`
}
// Main information about resource group
type ItemResourceGroup struct {
//
AccountACL ItemACL `json:"accountAcl"`
2022-12-22 17:56:47 +03:00
// Account ID
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// Access Control List
ACL ListACL `json:"acl"`
2024-04-16 14:26:06 +03:00
// Compute Features
ComputeFeatures []string `json:"computeFeatures"`
2023-04-28 11:46:58 +03:00
// CPU allocation parameter
CPUAllocationParameter string `json:"cpu_allocation_parameter"`
// CPU allocation ratio
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
2022-12-22 17:56:47 +03:00
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// DefNetID
DefNetID int64 `json:"def_net_id"`
// DefNetType
DefNetType string `json:"def_net_type"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
// Description
Description string `json:"desc"`
// Dirty
Dirty bool `json:"dirty"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// Lock status
LockStatus string `json:"lockStatus"`
// Milestones
Milestones uint64 `json:"milestones"`
// Name
Name string `json:"name"`
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
2023-04-28 11:46:58 +03:00
// List of resource types
ResTypes []string `json:"resourceTypes"`
2025-07-15 17:39:18 +03:00
// SDN access group id
SDNAccessGroupID string `json:"sdn_access_group_id"`
2025-08-29 12:51:25 +03:00
// Storage policy ids
StoragePolicyIDs []uint64 `json:"storage_policy_ids"`
2022-12-22 17:56:47 +03:00
// Secret
Secret string `json:"secret"`
// Status
Status string `json:"status"`
2023-04-28 11:46:58 +03:00
// UniqPools
UniqPools []string `json:"uniqPools"`
2022-12-22 17:56:47 +03:00
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// List of VINS IDs
VINS []uint64 `json:"vins"`
// List of compute IDs
Computes []uint64 `json:"vms"`
}
// List of resource groups
2023-06-30 11:21:47 +03:00
type ListResourceGroups struct {
Data []ItemResourceGroup `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main information about Access Control List
type ItemACL struct {
// Explicit
Explicit bool `json:"explicit"`
// GUID
GUID string `json:"guid"`
// Right
Right string `json:"right"`
// Status
Status string `json:"status"`
// Type
Type string `json:"type"`
// User group ID
2022-08-11 08:09:54 +00:00
UserGroupID string `json:"userGroupId"`
}
2022-12-22 17:56:47 +03:00
// List ACL
type ListACL []ItemACL
// Resource limits
2022-08-11 08:09:54 +00:00
type ResourceLimits struct {
2022-12-22 17:56:47 +03:00
// CUC
CUC float64 `json:"CU_C"`
// CUD
CUD float64 `json:"CU_D"`
2023-06-30 11:21:47 +03:00
// CUDM
CUDM float64 `json:"CU_DM"`
2022-12-22 17:56:47 +03:00
// CUI
CUI float64 `json:"CU_I"`
// CUM
CUM float64 `json:"CU_M"`
// GPU units
2022-08-11 08:09:54 +00:00
GPUUnits float64 `json:"gpu_units"`
2025-08-29 12:51:25 +03:00
// Storage policies
StoragePolicies []StoragePolicy `json:"storage_policy"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// Main information about affinity group
2023-07-21 15:14:10 +03:00
type ItemAffinityGroupComputes struct {
2022-12-22 17:56:47 +03:00
// Compute ID
ComputeID uint64 `json:"computeId"`
// Other node
OtherNode []uint64 `json:"otherNode"`
// Other node indirect
OtherNodeIndirect []uint64 `json:"otherNodeIndirect"`
// Other node indirect soft
2022-08-11 08:09:54 +00:00
OtherNodeIndirectSoft []uint64 `json:"otherNodeIndirectSoft"`
2022-12-22 17:56:47 +03:00
// Other node soft
OtherNodeSoft []uint64 `json:"otherNodeSoft"`
// Same node
SameNode []uint64 `json:"sameNode"`
// Same node soft
SameNodeSoft []uint64 `json:"sameNodeSoft"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of affinity groups
2023-07-21 15:14:10 +03:00
type ListAffinityGroupsComputes []ItemAffinityGroupComputes
2024-04-16 14:26:06 +03:00
// Main information about
type ItemAffinityGroup struct {
ID uint64 `json:"id"`
NodeID uint64 `json:"node_id"`
}
// List of affinity group
type ListAffinityGroup []ItemAffinityGroup
2024-03-14 14:52:56 +03:00
// List of affinity groups
2023-07-21 15:14:10 +03:00
type ListAffinityGroups struct {
// Data
2024-04-16 14:26:06 +03:00
Data []map[string]ListAffinityGroup `json:"data"`
2023-07-21 15:14:10 +03:00
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-08-11 08:09:54 +00:00
2022-12-22 17:56:47 +03:00
// Main information about audit
type ItemAudit struct {
// Call
Call string `json:"call"`
// Response time
2022-08-11 08:09:54 +00:00
ResponseTime float64 `json:"responsetime"`
2022-12-22 17:56:47 +03:00
// Status code
StatusCode uint64 `json:"statuscode"`
// Timestamp
Timestamp float64 `json:"timestamp"`
// User
User string `json:"user"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of audits
type ListAudits []ItemAudit
2023-03-01 11:44:08 +03:00
// Main information about affinity rules
type ItemRule struct {
// GUID
GUID string `json:"guid"`
// Key
Key string `json:"key"`
// Mode
Mode string `json:"mode"`
// Policy
Policy string `json:"policy"`
// Topology
Topology string `json:"topology"`
// Value
Value string `json:"value"`
}
// List of rules
type ListRules []ItemRule
2022-12-22 17:56:47 +03:00
// Main information about compute
type ItemCompute struct {
// Account ID
AccountID uint64 `json:"accountId"`
2022-08-11 08:09:54 +00:00
2022-12-22 17:56:47 +03:00
// Account name
AccountName string `json:"accountName"`
// Affinity label
2022-08-11 08:09:54 +00:00
AffinityLabel string `json:"affinityLabel"`
2022-12-22 17:56:47 +03:00
// List of affinity rules
2023-03-01 11:44:08 +03:00
AffinityRules ListRules `json:"affinityRules"`
2022-12-22 17:56:47 +03:00
// Affinity weight
2022-08-11 08:09:54 +00:00
AffinityWeight uint64 `json:"affinityWeight"`
2022-12-22 17:56:47 +03:00
// List of anti affinity rules
2023-03-01 11:44:08 +03:00
AntiAffinityRules ListRules `json:"antiAffinityRules"`
2022-12-22 17:56:47 +03:00
// Number of CPU
CPUs uint64 `json:"cpus"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Number of RAM
RAM uint64 `json:"ram"`
// Registered
Registered bool `json:"registered"`
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// Status
Status string `json:"status"`
// Tech status
TechStatus string `json:"techStatus"`
// Total disks size
TotalDisksSize uint64 `json:"totalDisksSize"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// User managed
UserManaged bool `json:"userManaged"`
// Number of ViNS connected
VINSConnected uint64 `json:"vinsConnected"`
}
// List of computes
2023-07-07 12:40:03 +03:00
type ListComputes struct {
//Data
Data []ItemCompute `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main information about load balancer
type RecordLoadBalancer struct {
// HAMode
HAMode bool `json:"HAmode"`
// Access Control List
ACL interface{} `json:"acl"`
2024-03-14 14:52:56 +03:00
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
2022-12-22 17:56:47 +03:00
// List of Backends
Backends ListBackends `json:"backends"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
// Description
Description string `json:"desc"`
// DPAPIUser
DPAPIUser string `json:"dpApiUser"`
// External network ID
ExtNetID uint64 `json:"extnetId"`
2024-03-14 14:52:56 +03:00
// FrontendHAIP
FrontendHAIP string `json:"frontendHAIP"`
2022-12-22 17:56:47 +03:00
// List of frontends
Frontends ListFrontends `json:"frontends"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// Image ID
ImageID uint64 `json:"imageId"`
// Milestones
Milestones uint64 `json:"milestones"`
// Name
Name string `json:"name"`
// Primary node
PrimaryNode RecordNode `json:"primaryNode"`
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// Secondary node
SecondaryNode RecordNode `json:"secondaryNode"`
// Status
Status string `json:"status"`
// Tech status
TechStatus string `json:"techStatus"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// VINS ID
VINSID uint64 `json:"vinsId"`
}
// Detailed information about load balancer
type ItemLoadBalancer struct {
// DPAPI password
2022-08-11 08:09:54 +00:00
DPAPIPassword string `json:"dpApiPassword"`
2022-12-22 17:56:47 +03:00
// Main information about load balancer
RecordLoadBalancer
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// Main information about backend
type ItemBackend struct {
// Algorithm
Algorithm string `json:"algorithm"`
// GUID
GUID string `json:"guid"`
// Name
Name string `json:"name"`
// Server settings
ServerDefaultSettings RecordServerSettings `json:"serverDefaultSettings"`
// List of servers
Servers ListServers `json:"servers"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of backends
type ListBackends []ItemBackend
// List of load balancers
2023-07-07 12:40:03 +03:00
type ListLB struct {
// Data
Data []ItemLoadBalancer `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Server settings
type RecordServerSettings struct {
// Inter
Inter uint64 `json:"inter"`
2022-08-11 08:09:54 +00:00
2022-12-22 17:56:47 +03:00
// GUID
GUID string `json:"guid"`
// Down inter
2022-08-11 08:09:54 +00:00
DownInter uint64 `json:"downinter"`
2022-12-22 17:56:47 +03:00
// Rise
Rise uint64 `json:"rise"`
// Fall
Fall uint64 `json:"fall"`
// Slow start
2022-08-11 08:09:54 +00:00
SlowStart uint64 `json:"slowstart"`
2022-12-22 17:56:47 +03:00
// Max connections
MaxConn uint64 `json:"maxconn"`
// Max queue
MaxQueue uint64 `json:"maxqueue"`
// Weight
Weight uint64 `json:"weight"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// Main information about server
type ItemServer struct {
// Address
Address string `json:"address"`
// Check
Check string `json:"check"`
// GUID
GUID string `json:"guid"`
// Name
Name string `json:"name"`
// Port
Port uint64 `json:"port"`
// Server settings
ServerSettings RecordServerSettings `json:"serverSettings"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of servers
type ListServers []ItemServer
// Main information about node
type RecordNode struct {
// Backend IP
BackendIP string `json:"backendIp"`
// Compute ID
ComputeID uint64 `json:"computeId"`
// Frontend IP
2022-10-03 16:56:47 +03:00
FrontendIP string `json:"frontendIp"`
2022-12-22 17:56:47 +03:00
// GUID
GUID string `json:"guid"`
// MGMT IP
MGMTIP string `json:"mgmtIp"`
// Network ID
NetworkID uint64 `json:"networkId"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// Main information about frontend
type ItemFrontend struct {
// Backend
Backend string `json:"backend"`
// List of bindings
Bindings ListBindings `json:"bindings"`
// GUID
GUID string `json:"guid"`
// Name
Name string `json:"name"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of frontends
type ListFrontends []ItemFrontend
// Main information of binding
type ItemBinding struct {
// Address
2022-08-11 08:09:54 +00:00
Address string `json:"address"`
2022-12-22 17:56:47 +03:00
// GUID
GUID string `json:"guid"`
// Name
Name string `json:"name"`
// Port
Port uint64 `json:"port"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of bindings
type ListBindings []ItemBinding
// Main information about port forward
type ItemPortForward struct {
// Public port end
PublicPortEnd uint64 `json:"Public Port End"`
// Public port start
2022-10-03 16:56:47 +03:00
PublicPortStart uint64 `json:"Public Port Start"`
2022-12-22 17:56:47 +03:00
// Virtual machine ID
VMID uint64 `json:"VM ID"`
// Virtual machine IP
VMIP string `json:"VM IP"`
// Virtual machine name
VMName string `json:"VM Name"`
// Virtual machine port
VMPort uint64 `json:"VM Port"`
// VINS ID
VINSID uint64 `json:"ViNS ID"`
// VINS name
VINSName string `json:"ViNS Name"`
2022-08-11 08:09:54 +00:00
}
2022-12-22 17:56:47 +03:00
// List of port forwards
2023-07-07 12:40:03 +03:00
type ListPortForwards struct {
//Data
Data []ItemPortForward `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-12-22 17:56:47 +03:00
// Main information about VINS
type ItemVINS struct {
// Account ID
AccountID uint64 `json:"accountId"`
2022-08-11 08:09:54 +00:00
2022-12-22 17:56:47 +03:00
// Account name
2022-08-11 08:09:54 +00:00
AccountName string `json:"accountName"`
2022-12-22 17:56:47 +03:00
// Computes
Computes uint64 `json:"computes"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
2022-08-11 08:09:54 +00:00
CreatedTime uint64 `json:"createdTime"`
2022-12-22 17:56:47 +03:00
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
2022-08-11 08:09:54 +00:00
DeletedTime uint64 `json:"deletedTime"`
2022-12-22 17:56:47 +03:00
// External IP
ExternalIP string `json:"externalIP"`
2024-04-16 14:26:06 +03:00
// Extnet ID
ExtnetId uint64 `json:"extnetId"`
// Free IPs
2024-08-26 17:51:34 +03:00
FreeIPs int64 `json:"freeIPs"`
2024-04-16 14:26:06 +03:00
2022-12-22 17:56:47 +03:00
// ID
ID uint64 `json:"id"`
// Name
Name string `json:"name"`
// Network
Network string `json:"network"`
// PriVNFDev ID
2022-08-11 08:09:54 +00:00
PriVNFDevID uint64 `json:"priVnfDevId"`
2022-12-22 17:56:47 +03:00
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// Status
Status string `json:"status"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
2022-08-11 08:09:54 +00:00
UpdatedTime uint64 `json:"updatedTime"`
}
2022-12-22 17:56:47 +03:00
// List of VINSes
2023-07-07 12:40:03 +03:00
type ListVINS struct {
// Data
Data []ItemVINS `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
2022-08-11 08:09:54 +00:00
2022-12-22 17:56:47 +03:00
// Main information about usage of resource
type RecordResourceUsage struct {
// Number of CPU
CPU uint64 `json:"cpu"`
// Disk size
2023-04-20 11:17:35 +03:00
DiskSize float64 `json:"disksize"`
// Max disk size
DiskSizeMax uint64 `json:"disksizemax"`
2022-12-22 17:56:47 +03:00
// Number of external IPs
ExtIPs uint64 `json:"extips"`
// Number of GPU
GPU uint64 `json:"gpu"`
// Number of RAM
RAM uint64 `json:"ram"`
2023-04-20 11:17:35 +03:00
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
2022-08-11 08:09:54 +00:00
}