This commit is contained in:
2024-03-18 15:18:17 +03:00
parent cf11855fa3
commit e7b30fb686
12 changed files with 44 additions and 20 deletions

View File

@@ -169,6 +169,15 @@ type ItemSnapshot struct {
}
// List of Snapshots
type ListInfoSnapshots struct {
// Data
Data ListSnapshots `json:"data"`
// EntryCount
EntryCount uint64 `json:"entryCount"`
}
// List of Snapshots inside RecordBasicService
type ListSnapshots []ItemSnapshot
// Main information about Group

View File

@@ -16,7 +16,7 @@ type SnapshotListRequest struct {
}
// SnapshotList gets list existing snapshots of the Basic Service
func (b BService) SnapshotList(ctx context.Context, req SnapshotListRequest) (ListSnapshots, error) {
func (b BService) SnapshotList(ctx context.Context, req SnapshotListRequest) (*ListInfoSnapshots, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
@@ -29,12 +29,12 @@ func (b BService) SnapshotList(ctx context.Context, req SnapshotListRequest) (Li
return nil, err
}
list := ListSnapshots{}
list := ListInfoSnapshots{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return list, nil
return &list, nil
}

View File

@@ -29,7 +29,7 @@ type CreateRequest struct {
WorkerGroupName string `url:"workerGroupName" json:"workerGroupName" validate:"required,workerGroupName"`
// Network plugin
// Must be one of these values: flannel, weawenet, calico
// Must be one of these values: flannel, weavenet, calico
// Required: true
NetworkPlugin string `url:"networkPlugin" json:"networkPlugin" validate:"required,networkPlugin"`

View File

@@ -331,9 +331,18 @@ 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
type ListAffinityGroups struct {
// Data
Data []map[string][]uint64 `json:"data"`
Data []map[string]ListAffinityGroup `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`

View File

@@ -60,7 +60,7 @@ type CreateRequest struct {
MaxWorkerCount uint64 `url:"maxWorkerCount" json:"maxWorkerCount" validate:"required"`
// Network plugins
// Values of slice must be flannel, weawenet or calico
// Values of slice must be flannel, weavenet or calico
//Required: true
NetworkPlugins []string `url:"networkPlugins" json:"networkPlugins" validate:"required,networkPlugins"`
}

View File

@@ -16,7 +16,7 @@ type DeleteRequest struct {
// Delete permanently or not
// Required: false
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
Permanently bool `url:"permanently" json:"permanently"`
}
// Delete deletes K8CI by ID

View File

@@ -29,7 +29,7 @@ type CreateRequest struct {
WorkerGroupName string `url:"workerGroupName" json:"workerGroupName" validate:"required,workerGroupName"`
// Network plugin
// Must be one of these values: flunnel, weawenet, calico
// Must be one of these values: flannel, weavenet, calico
// Required: true
NetworkPlugin string `url:"networkPlugin" json:"networkPlugin" validate:"required,networkPlugin"`

View File

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