v1.6.7
This commit is contained in:
@@ -8,24 +8,22 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for restart services
|
||||
// ServicesRestartRequest struct to restart services
|
||||
type ServicesRestartRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
|
||||
// Node ID
|
||||
// Required: true
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
}
|
||||
|
||||
// ServicesRestart restarts decort services on the node
|
||||
func (g Grid) ServicesRestart(ctx context.Context, req ServicesRestartRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/grid/servicesRestart"
|
||||
|
||||
Reference in New Issue
Block a user