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

@@ -18,6 +18,11 @@ type ChangeDiskStoragePolicyRequest struct {
// ID of the storage policy to which to connect account
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Keep current disk I/O tune settings in the domain XML
// Required: false
// Default: false
KeepCurrentIOTune interface{} `url:"keep_current_iot,omitempty" json:"keep_current_iot,omitempty" validate:"omitempty,isBool"`
}
type wrapperChangeDiskStoragePolicyRequest struct {

View File

@@ -67,6 +67,30 @@ type LimitIORequest struct {
// Required: false
WriteIOPSSecMax uint64 `url:"write_iops_sec_max,omitempty" json:"write_iops_sec_max,omitempty"`
// Duration in seconds of the total bytes burst. Requires TotalBytesSecMax
// Required: false
TotalBytesSecMaxLength uint64 `url:"total_bytes_sec_max_length,omitempty" json:"total_bytes_sec_max_length,omitempty"`
// Duration in seconds of the read bytes burst. Requires ReadBytesSecMax
// Required: false
ReadBytesSecMaxLength uint64 `url:"read_bytes_sec_max_length,omitempty" json:"read_bytes_sec_max_length,omitempty"`
// Duration in seconds of the write bytes burst. Requires WriteBytesSecMax
// Required: false
WriteBytesSecMaxLength uint64 `url:"write_bytes_sec_max_length,omitempty" json:"write_bytes_sec_max_length,omitempty"`
// Duration in seconds of the total IOPS burst. Requires TotalIOPSSecMax
// Required: false
TotalIOPSSecMaxLength uint64 `url:"total_iops_sec_max_length,omitempty" json:"total_iops_sec_max_length,omitempty"`
// Duration in seconds of the read IOPS burst. Requires ReadIOPSSecMax
// Required: false
ReadIOPSSecMaxLength uint64 `url:"read_iops_sec_max_length,omitempty" json:"read_iops_sec_max_length,omitempty"`
// Duration in seconds of the write IOPS burst. Requires WriteIOPSSecMax
// Required: false
WriteIOPSSecMaxLength uint64 `url:"write_iops_sec_max_length,omitempty" json:"write_iops_sec_max_length,omitempty"`
// SizeIOPSSec
// Required: false
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`

View File

@@ -199,6 +199,9 @@ type InfoDisk struct {
// Cache mode of disk
Cache string `json:"cache"`
// Whether CRT is tracked
CRTTracking bool `json:"crt_tracking"`
}
type ItemReplication struct {

View File

@@ -30,6 +30,14 @@ type ReplicateRequest struct {
// ID of the storage policy under the disk will be created
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Copy rate for an asynchronous replication pair (in MB/s)
// Required: false
CopyRate uint64 `url:"copy_rate,omitempty" json:"copy_rate,omitempty"`
// Name of the schedule from the replication profile
// Required: false
Schedule string `url:"schedule,omitempty" json:"schedule,omitempty"`
}
type wrapperReplicateRequest struct {

View File

@@ -0,0 +1,38 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ReplicationDisableScheduleRequest to remove the schedule from an asynchronous replication pair
type ReplicationDisableScheduleRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
}
// ReplicationDisableSchedule removes the schedule from an asynchronous replication pair
func (d Disks) ReplicationDisableSchedule(ctx context.Context, req ReplicationDisableScheduleRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/replication_disable_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
}

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
}

View File

@@ -0,0 +1,78 @@
package disks
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ReplicationPromoteRequest to promote the primary side of an asynchronous replication pair
type ReplicationPromoteRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
}
type wrapperReplicationPromoteRequest struct {
ReplicationPromoteRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// ReplicationPromote promotes the primary side of an asynchronous replication pair
func (d Disks) ReplicationPromote(ctx context.Context, req ReplicationPromoteRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/replication_promote"
aReq := wrapperReplicationPromoteRequest{
ReplicationPromoteRequest: req,
AsyncMode: false,
}
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
// ReplicationPromoteAsync promotes the primary side of an asynchronous replication pair in async mode
func (d Disks) ReplicationPromoteAsync(ctx context.Context, req ReplicationPromoteRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/replication_promote"
aReq := wrapperReplicationPromoteRequest{
ReplicationPromoteRequest: req,
AsyncMode: true,
}
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
}

View File

@@ -14,6 +14,11 @@ type ReplicationReverseRequest struct {
// Id of the disk
// Required: true
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
// Use planned failover for asynchronous replication
// Required: false
// Default: true
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
}
type wrapperReplicationReverseRequest struct {

View File

@@ -0,0 +1,42 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ReplicationSetCopyRateRequest to set the copy rate of an asynchronous replication pair
type ReplicationSetCopyRateRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
// Copy rate in MB/s
// Required: true
CopyRate uint64 `url:"copy_rate" json:"copy_rate" validate:"required"`
}
// ReplicationSetCopyRate sets the copy rate of an asynchronous replication pair
func (d Disks) ReplicationSetCopyRate(ctx context.Context, req ReplicationSetCopyRateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/replication_set_copy_rate"
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
}

View File

@@ -18,6 +18,14 @@ type ReplicationStartRequest struct {
// ID of target disk. Secondary disk in replication
// Required: true
TargetDiskID uint64 `url:"targetDiskId" json:"targetDiskId" validate:"required"`
// Copy rate for an asynchronous replication pair (in MB/s)
// Required: false
CopyRate uint64 `url:"copy_rate,omitempty" json:"copy_rate,omitempty"`
// Name of the schedule from the replication profile
// Required: false
Schedule string `url:"schedule,omitempty" json:"schedule,omitempty"`
}
type wrapperReplicationStartRequest struct {

View File

@@ -0,0 +1,38 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ReplicationSyncNowRequest to start manual synchronization of an asynchronous replication pair
type ReplicationSyncNowRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
}
// ReplicationSyncNow starts manual synchronization of an asynchronous replication pair
func (d Disks) ReplicationSyncNow(ctx context.Context, req ReplicationSyncNowRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/replication_sync_now"
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
}