Compare commits

...

3 Commits

Author SHA1 Message Date
b069c31745 v1.6.5 2023-10-11 12:18:27 +03:00
2953ef0a85 v1.6.4 2023-10-03 16:44:32 +03:00
50a4d5ade2 v1.6.3 2023-09-29 12:28:16 +03:00
14 changed files with 227 additions and 98 deletions

View File

@@ -1,4 +1,7 @@
## Version 1.6.1
## Version 1.6.5
### Bugfix
- Fixed tags url and json CreateRequest in cloudapi/k8s/create and cloudbroker/k8s/create
## Feature
- Add field and type LibvirtDaemon in model Packages in cloudbroker/stack/models
- Add field and type Packages in model ItemListStacks in cloudbroker/image/models. Add fields and type LibvirtBin, LibvirtDaemon, Lvm2Lockd, OpenvswitchCommon, OpenvswitchSwitch, QemuSystemX86, Sanlock
- Add filter ByGID in cloudbroker/grid/filters
- Add field userData in models WorkersGroupAddRequest in cloudapi/k8s and cloudbroker/k8s

View File

@@ -88,7 +88,7 @@ type Resource struct {
DiskSize float64 `json:"disksize"`
// Max disk size
DiskSizeMax uint64 `json:"disksizemax"`
DiskSizeMax float64 `json:"disksizemax"`
// Number of External IPs
ExtIPs int64 `json:"extips"`
@@ -126,10 +126,10 @@ type RecordResourceConsumption struct {
// Information about resources
type ItemResourceConsumption struct {
// Current information about resources
Current Resource `json:"Current"`
Consumed Resource `json:"consumed"`
// Reserved information about resources
Reserved Resource `json:"Reserved"`
Reserved Resource `json:"reserved"`
// Account ID
AccountID uint64 `json:"id"`

View File

@@ -22,9 +22,9 @@ type ListPCIDeviceRequest struct {
// Required: false
DevID uint64 `url:"devId,omitempty" json:"devId,omitempty"`
// Find by type
// Find by name
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
// Find by status
// Required: false

View File

@@ -32,10 +32,6 @@ type ListDeletedRequest struct {
// Required: false
BasicServiceID uint64 `url:"basicServiceId,omitempty" json:"basicServiceId,omitempty"`
// Find by status
// Required: false
Status string `url:"status,omitempty" json:"status,omitempty"`
// Find by techStatus
// Required: false
TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"`

View File

@@ -56,6 +56,10 @@ type WorkersGroupAddRequest struct {
// Worker node boot disk size in GB If 0 is specified, size is defined by the OS image size
// Required: false
WorkerDisk uint64 `url:"workerDisk,omitempty" json:"workerDisk,omitempty"`
// Meta data for working group computes, format YAML "user_data": 1111
// Required: false
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
}
// WorkersGroupAdd adds workers group to Kubernetes cluster

View File

@@ -6,7 +6,7 @@ type RecordLB struct {
HAMode bool `json:"HAmode"`
// Access Control List
ACL []interface{} `json:"acl"`
ACL interface{} `json:"acl"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
@@ -78,7 +78,7 @@ type RecordLB struct {
Status string `json:"status"`
// Sysctl Params
SysctlParams []interface{} `json:"sysctlParams"`
SysctlParams interface{} `json:"sysctlParams"`
// Tech status
TechStatus string `json:"techStatus"`

View File

@@ -13,6 +13,14 @@ type AffinityGroupsListRequest struct {
// Resource group ID
// Required: true
RGID uint64 `url:"rgId" json:"rgId" validate:"required"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// AffinityGroupsList gets all currently defined affinity groups in this resource group with compute IDs

View File

@@ -48,10 +48,10 @@ type Resources struct {
// Detailed information about resource consumption
type ItemResourceConsumption struct {
// Consumed information about resources
Consumed Resource `json:"Consumed"`
Consumed Resource `json:"consumed"`
// Reserved information about resources
Reserved Resource `json:"Reserved"`
Reserved Resource `json:"reserved"`
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
@@ -333,7 +333,7 @@ type ListAffinityGroupsComputes []ItemAffinityGroupComputes
type ListAffinityGroups struct {
// Data
Data map[string][]uint64 `json:"data"`
Data []map[string][]uint64 `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`

View File

@@ -9,6 +9,15 @@ func (lg ListGrids) FilterByID(id uint64) ListGrids {
return lg.FilterFunc(predicate)
}
// FilterByGID returns ListGrids with specified GID.
func (lg ListGrids) FilterByGID(gid uint64) ListGrids {
predicate := func(rg ItemGridList) bool {
return rg.GID == gid
}
return lg.FilterFunc(predicate)
}
// FilterByName returns ListGrids with specified Name.
func (lg ListGrids) FilterByName(name string) ListGrids {
predicate := func(rg ItemGridList) bool {

View File

@@ -106,6 +106,14 @@ func TestFilterByID(t *testing.T) {
}
}
func TestFilterByGID(t *testing.T) {
actual := grids.FilterByGID(777).FindOne()
if actual.GID != 777 {
t.Fatal("expected ID 777, found: ", actual.GID)
}
}
func TestFilterByName(t *testing.T) {
actual := grids.FilterByName("gamma").FindOne()

View File

@@ -176,10 +176,10 @@ type GUID string
func (r *GUID) UnmarshalJSON(b []byte) error {
if b[0] == '"' {
*r = GUID(string(b[1:len(b)-1]))
*r = GUID(string(b[1 : len(b)-1]))
return nil
}
*r = GUID(string(b))
return nil
@@ -190,74 +190,167 @@ type ListHistory []History
// List stacks
type ListStacks struct {
Data []struct {
// CKey
CKey string `json:"_ckey"`
// Meta
Meta []interface{} `json:"_meta"`
// API URL
APIURL string `json:"apiUrl"`
// API key
APIKey string `json:"apikey"`
// App ID
AppID string `json:"appId"`
// CPU allocation ratio
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
// Description
Description string `json:"desc"`
// Descr
Descr string `json:"descr"`
// Drivers
Drivers []string `json:"drivers"`
// Eco
Eco interface{} `json:"eco"`
// Error
Error uint64 `json:"error"`
// Grid ID
GID uint64 `json:"gid"`
// GID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// List image IDs
Images []uint64 `json:"images"`
// Login
Login string `json:"login"`
// Mem allocation ratio
// Required: false
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
// Name
Name string `json:"name"`
// Password
Password string `json:"passwd"`
// Reference ID
ReferenceID string `json:"referenceId"`
// Status
Status string `json:"status"`
// Type
Type string `json:"type"`
} `json:"data"`
// Data
Data []ItemListStacks `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
// Detailed information about image
type ItemListStacks struct {
// CKey
CKey string `json:"_ckey"`
// Meta
Meta []interface{} `json:"_meta"`
// API URL
APIURL string `json:"apiUrl"`
// API key
APIKey string `json:"apikey"`
// App ID
AppID string `json:"appId"`
// CPU allocation ratio
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
// Description
Description string `json:"desc"`
// Descr
Descr string `json:"descr"`
// Drivers
Drivers []string `json:"drivers"`
// Eco
Eco interface{} `json:"eco"`
// Error
Error uint64 `json:"error"`
// Grid ID
GID uint64 `json:"gid"`
// GID
GUID uint64 `json:"guid"`
// ID
ID uint64 `json:"id"`
// List image IDs
Images []uint64 `json:"images"`
// Login
Login string `json:"login"`
// Mem allocation ratio
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
// Name
Name string `json:"name"`
// Packegas
Packages Packages `json:"packages"`
// Password
Password string `json:"passwd"`
// Reference ID
ReferenceID string `json:"referenceId"`
// Status
Status string `json:"status"`
// Type
Type string `json:"type"`
}
// Package
type Packages struct {
// LibvirtBin
LibvirtBin LibvirtBin `json:"libvirt-bin"`
// LibvirtDaemon
LibvirtDaemon LibvirtDaemon `json:"libvirt-daemon"`
// Lvm2Lockd
Lvm2Lockd Lvm2Lockd `json:"lvm2-lockd"`
// OpenvswitchCommon
OpenvswitchCommon OpenvswitchCommon `json:"openvswitch-common"`
// OpenvswitchSwitch
OpenvswitchSwitch OpenvswitchSwitch `json:"openvswitch-switch"`
// QemuSystemX86
QemuSystemX86 QemuSystemX86 `json:"qemu-system-x86"`
// Sanlock
Sanlock Sanlock `json:"sanlock"`
}
// LibvirtBin
type LibvirtBin struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
type LibvirtDaemon struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
// Lvm2Lockd
type Lvm2Lockd struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
// OpenvswitchCommon
type OpenvswitchCommon struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
// OpenvswitchSwitch
type OpenvswitchSwitch struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
// QemuSystemX86
type QemuSystemX86 struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
// Sanlock
type Sanlock struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}

View File

@@ -58,6 +58,10 @@ type WorkersGroupAddRequest struct {
// Worker node boot disk size in GB If 0 is specified, size is defined by the OS image size
// Required: false
WorkerDisk uint64 `url:"workerDisk,omitempty" json:"workerDisk,omitempty"`
// Meta data for working group computes, format YAML "user_data": 1111
// Required: false
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
}
// WorkersGroupAdd adds workers group to kubernetes cluster

View File

@@ -154,7 +154,7 @@ type RecordLB struct {
Meta []interface{} `json:"_meta"`
// Access Control List
ACL []interface{} `json:"acl"`
ACL interface{} `json:"acl"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
@@ -214,7 +214,7 @@ type RecordLB struct {
Status string `json:"status"`
// Sysctl Params
SysctlParams []string `json:"sysctlParams"`
SysctlParams interface{} `json:"sysctlParams"`
// Tech status
TechStatus string `json:"techStatus"`
@@ -229,7 +229,7 @@ type ItemLBList struct {
HAMode bool `json:"HAmode"`
// Access Control List
ACL []interface{} `json:"acl"`
ACL interface{} `json:"acl"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
@@ -298,7 +298,7 @@ type ItemLBList struct {
Status string `json:"status"`
// Sysctl Params
SysctlParams []string `json:"sysctlParams"`
SysctlParams interface{} `json:"sysctlParams"`
// Tech status
TechStatus string `json:"techStatus"`

View File

@@ -43,6 +43,7 @@ type InfoStack struct {
// ID
ID uint64 `json:"id"`
// List image IDs
Images []uint64 `json:"images"`
@@ -73,7 +74,6 @@ type InfoStack struct {
// List of stacks
type ListStacks struct {
//List
Data []InfoStack `json:"data"`
@@ -83,10 +83,12 @@ type ListStacks struct {
// Package
type Packages struct {
// LibvirtBin
LibvirtBin LibvirtBin `json:"libvirt-bin"`
// LibvirtDaemon
LibvirtDaemon LibvirtDaemon `json:"libvirt-daemon"`
// Lvm2Lockd
Lvm2Lockd Lvm2Lockd `json:"lvm2-lockd"`
@@ -105,7 +107,14 @@ type Packages struct {
// LibvirtBin
type LibvirtBin struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
// Version
Ver string `json:"ver"`
}
type LibvirtDaemon struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
@@ -115,7 +124,6 @@ type LibvirtBin struct {
// Lvm2Lockd
type Lvm2Lockd struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
@@ -125,7 +133,6 @@ type Lvm2Lockd struct {
// OpenvswitchCommon
type OpenvswitchCommon struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
@@ -135,7 +142,6 @@ type OpenvswitchCommon struct {
// OpenvswitchSwitch
type OpenvswitchSwitch struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
@@ -145,7 +151,6 @@ type OpenvswitchSwitch struct {
// QemuSystemX86
type QemuSystemX86 struct {
// InstalledSize
InstalledSize string `json:"installed_size"`
@@ -155,7 +160,6 @@ type QemuSystemX86 struct {
// Sanlock
type Sanlock struct {
// InstalledSize
InstalledSize string `json:"installed_size"`