v1.16.7
This commit is contained in:
dayterr
2026-10-09 16:23:35 +03:00
parent 25e2242360
commit 8cde0e9371
80 changed files with 2303 additions and 606 deletions

View File

@@ -0,0 +1,46 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ReplicationEnableScheduleRequest to apply a replication profile schedule to an asynchronous replication pair
type ReplicationEnableScheduleRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
// ID of the replication profile assigned to the pair
// Required: true
ProfileID uint64 `url:"profile_id" json:"profile_id" validate:"required"`
// Name of the interval or calendar schedule from the profile
// Required: true
ScheduleName string `url:"schedule_name" json:"schedule_name" validate:"required"`
}
// ReplicationEnableSchedule applies a replication profile schedule to an asynchronous replication pair
func (d Disks) ReplicationEnableSchedule(ctx context.Context, req ReplicationEnableScheduleRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/replication_enable_schedule"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}