v9.0.0
This commit is contained in:
36
pkg/cloudbroker/node/set_core_isolation.go
Normal file
36
pkg/cloudbroker/node/set_core_isolation.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v9/internal/validators"
|
||||
)
|
||||
|
||||
// SetCoreIsolationRequest struct to isolate selected cores on node boot
|
||||
type SetCoreIsolationRequest struct {
|
||||
// Node ID
|
||||
// Required: true
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
|
||||
// List of core number to isolate
|
||||
// Required: false
|
||||
CoreList []uint64 `url:"coreList,omitempty" json:"coreList,omitempty"`
|
||||
}
|
||||
|
||||
// SetCoreIsolation isolates selected cores on node boot
|
||||
func (n Node) SetCoreIsolation(ctx context.Context, req SetCoreIsolationRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/node/setCoreIsolation"
|
||||
|
||||
res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(res), nil
|
||||
}
|
||||
Reference in New Issue
Block a user