This commit is contained in:
2024-03-14 14:52:56 +03:00
parent 55027a1605
commit d137c7507a
50 changed files with 1965 additions and 720 deletions

View File

@@ -24,7 +24,7 @@ func (b BService) Disable(ctx context.Context, req DisableRequest) (bool, error)
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/bservice/disable"
url := "/cloudapi/bservice/delete"
res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {

View File

@@ -93,7 +93,7 @@ type RecordBasicService struct {
// Main information about Compute
type ItemCompute struct {
// Account ID
AccountID uint64
AccountID uint64 `json:"accountId"`
// Architecture
Architecture string `json:"arch"`
@@ -168,6 +168,9 @@ type ItemSnapshot struct {
Valid bool `json:"valid"`
}
// List of Snapshot
type ListSnapshots []ItemSnapshot
// List of Snapshots
type ListInfoSnapshots struct {
// Data
@@ -177,9 +180,6 @@ type ListInfoSnapshots struct {
EntryCount uint64 `json:"entryCount"`
}
// List of Snapshots inside RecordBasicService
type ListSnapshots []ItemSnapshot
// Main information about Group
type RecordGroup struct {
// Account ID

View File

@@ -380,6 +380,9 @@ type RecordCompute struct {
// Name
Name string `json:"name"`
// NeedReboot
NeedReboot bool `json:"needReboot"`
// Natable VINS ID
NatableVINSID uint64 `json:"natableVinsId"`
@@ -857,6 +860,9 @@ type ItemCompute struct {
// Name
Name string `json:"name"`
// NeedReboot
NeedReboot bool `json:"needReboot"`
// Pinned or not
Pinned bool `json:"pinned"`

View File

@@ -16,7 +16,7 @@ type GetRequest struct {
// If set to False returns only images in status CREATED
// Required: false
ShowAll bool `url:"show_all,omitempty" json:"show_all,omitempty"`
ShowAll bool `url:"showAll,omitempty" json:"showAll,omitempty"`
}
// Get gets image by ID.

View File

@@ -10,7 +10,7 @@ import (
type ListRequest struct {
// Find by ID
// Required: false
ByID uint64 `url:"id,omitempty" json:"id,omitempty"`
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
// Find by name
// Required: false

View File

@@ -202,7 +202,7 @@ func (k8s K8S) Create(ctx context.Context, req CreateRequest) (string, error) {
url := "/cloudapi/k8s/create"
res, err := k8s.client.DecortApiCall(ctx, http.MethodPost, url, req)
res, err := k8s.client.DecortApiCallMP(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}

View File

@@ -17,7 +17,7 @@ type DeleteRequest struct {
// True if cluster is destroyed permanently.
// Otherwise it can be restored from Recycle Bin
// Required: true
Permanently bool `url:"permanently" json:"permanently" validate:"required"`
Permanently bool `url:"permanently" json:"permanently"`
}
// Delete deletes kubernetes cluster

View File

@@ -18,7 +18,7 @@ type ListRequest struct {
// Find by account ID
// Required: false
AccountID uint64 `url:"accountID,omitempty" json:"accountID,omitempty"`
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Find by resource group ID
// Required: false

View File

@@ -13,6 +13,11 @@ type RestartRequest struct {
// ID of the load balancer instance to restart
// Required: true
LBID uint64 `url:"lbId" json:"lbId" validate:"required"`
// restart secondary and primary nodes sequentially in HA mode
// Default is true
// Required: false
Safe bool `url:"safe" json:"safe"`
}
// Restart restarts specified load balancer instance

View File

@@ -2,6 +2,9 @@ package locations
// Main information about locations
type ItemLocation struct {
// AuthBroker
AuthBroker []string `json:"authBroker"`
// Grid ID
GID uint64 `json:"gid"`

View File

@@ -53,3 +53,14 @@ func (lrc ListResourceConsumption) IDs() []uint64 {
}
return res
}
// IDs gets array of ResourceGroupIDs from ListAffinityGroup struct
func (lag ListAffinityGroups) IDs() []uint64 {
res := make([]uint64, 0, len(lag.Data))
for _, ag := range lag.Data {
for _, v := range ag {
res = append(res, v...)
}
}
return res
}

View File

@@ -331,18 +331,10 @@ type ItemAffinityGroupComputes struct {
// List of affinity groups
type ListAffinityGroupsComputes []ItemAffinityGroupComputes
// Main information about
type ItemAffinityGroup struct {
ID uint64 `json:"id"`
NodeID uint64 `json:"node_id"`
}
// List of affinity group
type ListAffinityGroup []ItemAffinityGroup
// List of affinity groups
type ListAffinityGroups struct {
// Data
Data []map[string]ListAffinityGroup `json:"data"`
Data []map[string][]uint64 `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
@@ -485,6 +477,9 @@ type RecordLoadBalancer struct {
// Access Control List
ACL interface{} `json:"acl"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
// List of Backends
Backends ListBackends `json:"backends"`
@@ -509,6 +504,9 @@ type RecordLoadBalancer struct {
// External network ID
ExtNetID uint64 `json:"extnetId"`
// FrontendHAIP
FrontendHAIP string `json:"frontendHAIP"`
// List of frontends
Frontends ListFrontends `json:"frontends"`

View File

@@ -25,7 +25,8 @@ type CreateInRGRequest struct {
// External network ID
// Required: false
ExtNetID uint64 `url:"extNetId,omitempty" json:"extNetId,omitempty"`
// -1 - not connect to extnet, 0 - auto select, 1+ - extnet ID
ExtNetID int64 `url:"extNetId" json:"extNetId"`
// External IP, related only for extNetId >= 0
// Required: false