From f1e0f7abb686acbbb8728cfe3b032e16c9e9a91e Mon Sep 17 00:00:00 2001 From: Alexey Fetisov Date: Mon, 26 Aug 2024 17:51:34 +0300 Subject: [PATCH] v1.8.3 --- CHANGELOG.md | 10 +++++++--- internal/validators/values.go | 2 +- pkg/cloudapi/account/models.go | 2 +- pkg/cloudapi/extnet/models.go | 2 +- pkg/cloudapi/rg/models.go | 2 +- pkg/cloudapi/vins/models.go | 2 +- pkg/cloudbroker/account/models.go | 2 +- pkg/cloudbroker/disks/models.go | 2 +- pkg/cloudbroker/extnet/models.go | 6 +++--- pkg/cloudbroker/rg/models.go | 2 +- pkg/cloudbroker/sep/add_pool.go | 12 ++++-------- pkg/cloudbroker/vins/models.go | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2717eef..753ffa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ -## Version 1.8.2 +## Version 1.8.3 -### Feature +### Bugfix -- Add universal client for connections \ No newline at end of file +- Change validation conditions in field type in models IPReserveRequest (cloudapi/vins/ip_reserve and cloudbroker/vins/ip_reserve). +- Fixed the return value in cloudbroker/sep/AddPool +- Fixed the InfoDisk model in cloudbroker/disks/models +- Change variable types in fields freeIPs in models ItemVINS (cloudapi/account/listVins, cloudbroker/account/listVins, cloudapi/rg/listVins, cloudbroker/rg/listVins, cloudapi/vins/list, cloudapi/vins/listDeleted, cloudbroker/vins/list, cloudbroker/vins/listdeleted) +- Change variable types in fields freeIPs in models RecordExtNet (cloudapi/extnet/get, cloudbroker/extnet/get) and ItemExtNet(cloudbroker/extnet/list) \ No newline at end of file diff --git a/internal/validators/values.go b/internal/validators/values.go index 0f42b99..121321a 100644 --- a/internal/validators/values.go +++ b/internal/validators/values.go @@ -32,7 +32,7 @@ var ( rgDefNetValues = []string{"PRIVATE", "PUBLIC", "NONE"} rgNetTypeValues = []string{"PUBLIC", "PRIVATE"} - vinsTypeValues = []string{"DHCP", "VIP", "EXCLUDE"} + vinsTypeValues = []string{"DHCP", "VIP", "EXCLUDED"} imageBootTypeValues = []string{"uefi", "bios"} imageTypeValues = []string{"windows", "linux", "other"} diff --git a/pkg/cloudapi/account/models.go b/pkg/cloudapi/account/models.go index 8a3a4e1..f68b7e9 100644 --- a/pkg/cloudapi/account/models.go +++ b/pkg/cloudapi/account/models.go @@ -384,7 +384,7 @@ type ItemVINS struct { ExtnetId uint64 `json:"extnetId"` // Free IPs - FreeIPs uint64 `json:"freeIPs"` + FreeIPs int64 `json:"freeIPs"` // ID ID uint64 `json:"id"` diff --git a/pkg/cloudapi/extnet/models.go b/pkg/cloudapi/extnet/models.go index f48a781..257e2b9 100644 --- a/pkg/cloudapi/extnet/models.go +++ b/pkg/cloudapi/extnet/models.go @@ -170,7 +170,7 @@ type RecordExtNet struct { Excluded []Excluded `json:"excluded"` // Free IPs - FreeIPs uint64 `json:"free_ips"` + FreeIPs int64 `json:"free_ips"` // Gateway Gateway string `json:"gateway"` diff --git a/pkg/cloudapi/rg/models.go b/pkg/cloudapi/rg/models.go index ecba0fc..4f418ab 100644 --- a/pkg/cloudapi/rg/models.go +++ b/pkg/cloudapi/rg/models.go @@ -787,7 +787,7 @@ type ItemVINS struct { ExtnetId uint64 `json:"extnetId"` // Free IPs - FreeIPs uint64 `json:"freeIPs"` + FreeIPs int64 `json:"freeIPs"` // ID ID uint64 `json:"id"` diff --git a/pkg/cloudapi/vins/models.go b/pkg/cloudapi/vins/models.go index 4c27771..9216fc5 100644 --- a/pkg/cloudapi/vins/models.go +++ b/pkg/cloudapi/vins/models.go @@ -27,7 +27,7 @@ type ItemVINS struct { ExtnetId uint64 `json:"extnetId"` // Free IPs - FreeIPs uint64 `json:"freeIPs"` + FreeIPs int64 `json:"freeIPs"` // ID ID uint64 `json:"id"` diff --git a/pkg/cloudbroker/account/models.go b/pkg/cloudbroker/account/models.go index 6c998ac..de03ff0 100644 --- a/pkg/cloudbroker/account/models.go +++ b/pkg/cloudbroker/account/models.go @@ -537,7 +537,7 @@ type ItemVINS struct { ExtnetId uint64 `json:"extnetId"` // Free IPs - FreeIPs uint64 `json:"freeIPs"` + FreeIPs int64 `json:"freeIPs"` // ID ID uint64 `json:"id"` diff --git a/pkg/cloudbroker/disks/models.go b/pkg/cloudbroker/disks/models.go index 92203f2..6381751 100644 --- a/pkg/cloudbroker/disks/models.go +++ b/pkg/cloudbroker/disks/models.go @@ -156,7 +156,7 @@ type InfoDisk struct { Shareable bool `json:"shareable"` // Size max - SizeMax uint64 `json:"sizeMax"` + SizeMax int64 `json:"sizeMax"` // Size used SizeUsed float64 `json:"sizeUsed"` diff --git a/pkg/cloudbroker/extnet/models.go b/pkg/cloudbroker/extnet/models.go index d08a568..fb34768 100644 --- a/pkg/cloudbroker/extnet/models.go +++ b/pkg/cloudbroker/extnet/models.go @@ -71,7 +71,7 @@ type ItemExtNet struct { Description string `json:"desc"` // Free IPs number - FreeIPs uint64 `json:"freeIps"` + FreeIPs int64 `json:"freeIps"` // Grid ID GID uint64 `json:"gid"` @@ -152,7 +152,7 @@ type RecordExtNet struct { Excluded ListReservations `json:"excluded"` // Free IPs number - FreeIPs uint64 `json:"free_ips"` + FreeIPs int64 `json:"free_ips"` // Gateway Gateway string `json:"gateway"` @@ -237,4 +237,4 @@ type ItemRoutes struct { //Destination network mask in 255.255.255.255 format Netmask string `json:"netmask"` -} \ No newline at end of file +} diff --git a/pkg/cloudbroker/rg/models.go b/pkg/cloudbroker/rg/models.go index 698b744..d0d541b 100644 --- a/pkg/cloudbroker/rg/models.go +++ b/pkg/cloudbroker/rg/models.go @@ -401,7 +401,7 @@ type ItemVINS struct { ExtnetId uint64 `json:"extnetId"` // Free IPs - FreeIPs uint64 `json:"freeIPs"` + FreeIPs int64 `json:"freeIPs"` // ID ID uint64 `json:"id"` diff --git a/pkg/cloudbroker/sep/add_pool.go b/pkg/cloudbroker/sep/add_pool.go index 9a67788..5159edd 100644 --- a/pkg/cloudbroker/sep/add_pool.go +++ b/pkg/cloudbroker/sep/add_pool.go @@ -3,7 +3,6 @@ package sep import ( "context" "net/http" - "strconv" "repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators" ) @@ -25,23 +24,20 @@ type AddPoolRequest struct { } // AddPool adds pool to SEP -func (s SEP) AddPool(ctx context.Context, req AddPoolRequest) (bool, error) { +func (s SEP) AddPool(ctx context.Context, req AddPoolRequest) (string, error) { err := validators.ValidateRequest(req) if err != nil { - return false, validators.ValidationErrors(validators.GetErrors(err)) + return "", validators.ValidationErrors(validators.GetErrors(err)) } url := "/cloudbroker/sep/addPool" res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req) if err != nil { - return false, err + return "", err } - result, err := strconv.ParseBool(string(res)) - if err != nil { - return false, err - } + result := string(res) return result, nil } diff --git a/pkg/cloudbroker/vins/models.go b/pkg/cloudbroker/vins/models.go index 10aabfc..f5cdfcd 100644 --- a/pkg/cloudbroker/vins/models.go +++ b/pkg/cloudbroker/vins/models.go @@ -684,7 +684,7 @@ type ItemVINS struct { ExtnetId uint64 `json:"extnetId"` // Free IPs - FreeIPs uint64 `json:"freeIPs"` + FreeIPs int64 `json:"freeIPs"` // Grid ID GID uint64 `json:"gid"`