Files
decort-golang-sdk/pkg/cloudbroker/grid/models.go
2026-06-05 17:18:01 +03:00

288 lines
5.5 KiB
Go

package grid
// Resource information
type Resources struct {
// Current resources
Current RecordResource `json:"Current"`
// Reserved resources
Reserved RecordResource `json:"Reserved"`
}
// Resource consumption information
type RecordResourcesConsumption struct {
// Current resources
Consumed RecordResource `json:"Consumed"`
// Reserved resources
Reserved RecordResource `json:"Reserved"`
// GID
GID uint64 `json:"id"`
}
type ListResourceConsumption struct {
// Data
Data []RecordResourcesConsumption `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
// Resource details
type RecordResource struct {
// Number of CPU
CPU uint64 `json:"cpu"`
// Disk size
DiskSize float64 `json:"disksize"`
// Disk size max
DiskSizeMax int64 `json:"disksizemax"`
// External IPs
ExtIPs uint64 `json:"extips"`
// Number of GPU
GPU uint64 `json:"gpu"`
// Policies
Policies map[string]PolicyUsage `json:"policies"`
// Number of RAM
RAM uint64 `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
DiskSizeMax float64 `json:"disksizemax"`
}
// Policy usage details
type PolicyUsage struct {
// Disk usage
DiskUsage
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
// Detailed information about grid
type RecordGrid struct {
// AuthBroker
AuthBroker []interface{} `json:"authBroker"`
// Flag
Flag string `json:"flag"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// Location code
LocationCode string `json:"locationCode"`
// Name
Name string `json:"name"`
// Network modes
NetworkModes []string `json:"network_modes"`
// SDN support
SDNSupport bool `json:"sdn_support"`
// Is Zero Access enabled
ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
// Is BRO enabled
BROEnabled bool `json:"bro_enabled"`
}
// Information about grid
type ItemGridList struct {
// Resource information
Resources Resources `json:"Resources"`
// AuthBroker
AuthBroker []interface{} `json:"authBroker"`
// Flag
Flag string `json:"flag"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// Location code
LocationCode string `json:"locationCode"`
// Name
Name string `json:"name"`
// Network modes
NetworkModes []string `json:"network_modes"`
// SDN support
SDNSupport bool `json:"sdn_support"`
// Is Zero Access enabled
ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
// Is BRO enabled
BROEnabled bool `json:"bro_enabled"`
}
// List Grids
type ListGrids struct {
//Data
Data []ItemGridList `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
// List emails
type ListEmails struct {
//Data
Data []string `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
// Detailed information about grid settings
type RecordSettingsGrid struct {
//Allowed ports
Allowedports []int `json:"allowedports"`
//Cleanup retention period
CleanupRetentionPeriod uint64 `json:"cleanupRetentionPeriod"`
// CPU allocation ratio
CPUAllocationRatio uint64 `json:"cpu_allocation_ratio"`
// CPU allocation ratio for VMs
CPUAllocationRatioVM uint64 `json:"cpu_allocation_ratio_vm"`
// Custom backup path
CustomBackupPath []string `json:"custom_backup_path"`
//Docker registry
DockerRegistry DockerRegistry `json:"docker_registry"`
//Enable uptime monitor
EnableUptimeMonitor bool `json:"enableUptimeMonitor"`
//Extnet max prereservation num
ExtnetMaxPreReservationsNum int `json:"extnetMaxPreReservationsNum"`
//Healthcheck notifications
HealthcheckNotifications HealthcheckNotifications `json:"healthcheck_notifications"`
// Interface generation scheme
InterfaceGenerationScheme string `json:"interface_generation_scheme"`
//k8s cleanup enabled
K8sCleanupEnabled bool `json:"k8s_cleanup_enabled"`
//Limits
Limits interface{} `json:"limits"`
//Location url
LocationURL string `json:"location_url"`
// MAC address prefix
MACAddressPrefix string `json:"mac_address_prefix"`
//Net QOS
NetQOS NetQOS `json:"net_qos"`
//Networks
Networks string `json:"networks"`
// Node self stop timer uptime monitor
NodeSelfStopTimerUptimeMonitor uint64 `json:"nodeSelfStopTimerUptimeMonitor"`
// Node self stop uptime monitor
NodeSelfStopUptimeMonitor bool `json:"nodeSelfStopUptimeMonitor"`
//Prometheus
Prometheus Prometheus `json:"prometheus"`
//Vins max prereservation num
VinsMaxPreReservationsNum int `json:"vinsMaxPreReservationsNum"`
//Vnfdev mgmt net range
VnfdevMgmtNetRange string `json:"vnfdev_mgmt_net_range"`
}
// DockerRegistry in grid settings
type DockerRegistry struct {
//Password
Password string `json:"password"`
//Server
Server string `json:"server"`
//Username
Username string `json:"username"`
}
// NetQOS in grid settings
type NetQOS struct {
// ExtNet Net QOS settings
ExtNet SettingsNetQOS `json:"ext_net"`
// VINS Net QOS settings
VINS SettingsNetQOS `json:"vins"`
}
// SettingsNetQOS in grid settings
type SettingsNetQOS struct {
//ERate
ERate uint64 `json:"eRate"`
//InBurst
InBurst uint64 `json:"inBurst"`
//InRate
InRate uint64 `json:"inRate"`
}
// HealthcheckNotifications settings in grid
type HealthcheckNotifications struct {
//Emails
Emails []Emails `json:"emails"`
}
type Emails struct {
//Address
Address string `json:"address"`
//Enabled
Enabled bool `json:"enabled"`
}
// Prometheus setting in grid
type Prometheus struct {
//ScrapeInterval
ScrapeInterval int `json:"scrapeInterval"`
}