v1.16.7
v1.16.7
This commit is contained in:
@@ -18,6 +18,11 @@ type ChangeDiskStoragePolicyRequest struct {
|
||||
// ID of the storage policy to which to connect for disk
|
||||
// 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 {
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -154,6 +154,9 @@ type ItemDisk struct {
|
||||
|
||||
// Cache mode of disk
|
||||
Cache string `json:"cache"`
|
||||
|
||||
// Whether CRT is tracked
|
||||
CRTTracking bool `json:"crt_tracking"`
|
||||
}
|
||||
|
||||
type ItemDiskUnattached struct {
|
||||
@@ -300,6 +303,9 @@ type ItemDiskUnattached struct {
|
||||
|
||||
// Virtual machine ID
|
||||
VMID uint64 `json:"vmid"`
|
||||
|
||||
// Whether CRT is tracked
|
||||
CRTTracking bool `json:"crt_tracking"`
|
||||
}
|
||||
|
||||
// List of disks searched
|
||||
@@ -549,6 +555,9 @@ type RecordDisk struct {
|
||||
|
||||
// Cache mode of disk
|
||||
Cache string `json:"cache"`
|
||||
|
||||
// Whether CRT is tracked
|
||||
CRTTracking bool `json:"crt_tracking"`
|
||||
}
|
||||
|
||||
type ItemReplication struct {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
38
pkg/cloudapi/disks/replication_disable_schedule.go
Normal file
38
pkg/cloudapi/disks/replication_disable_schedule.go
Normal 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"`
|
||||
}
|
||||
|
||||
// ReplicationDisableScheduleRequest 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 := "/cloudapi/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
|
||||
}
|
||||
38
pkg/cloudapi/disks/replication_manual_sync.go
Normal file
38
pkg/cloudapi/disks/replication_manual_sync.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package disks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ReplicationManualSyncRequest to start manual synchronization of an asynchronous replication pair
|
||||
type ReplicationManualSyncRequest struct {
|
||||
// Disk ID
|
||||
// Required: true
|
||||
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
|
||||
}
|
||||
|
||||
// ReplicationManualSync starts manual synchronization of an asynchronous replication pair
|
||||
func (d Disks) ReplicationManualSync(ctx context.Context, req ReplicationManualSyncRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudapi/disks/replication_manual_sync"
|
||||
|
||||
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
|
||||
}
|
||||
78
pkg/cloudapi/disks/replication_promote.go
Normal file
78
pkg/cloudapi/disks/replication_promote.go
Normal 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 := "/cloudapi/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 := "/cloudapi/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
|
||||
}
|
||||
@@ -14,6 +14,10 @@ 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
|
||||
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
|
||||
}
|
||||
|
||||
type wrapperReplicationReverseRequest struct {
|
||||
|
||||
42
pkg/cloudapi/disks/replication_set_copy_rate.go
Normal file
42
pkg/cloudapi/disks/replication_set_copy_rate.go
Normal 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 := "/cloudapi/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
|
||||
}
|
||||
46
pkg/cloudapi/disks/replication_set_schedule.go
Normal file
46
pkg/cloudapi/disks/replication_set_schedule.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package disks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ReplicationSetScheduleRequest to apply a replication profile schedule to an asynchronous replication pair
|
||||
type ReplicationSetScheduleRequest 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"`
|
||||
}
|
||||
|
||||
// ReplicationSetSchedule applies a replication profile schedule to an asynchronous replication pair
|
||||
func (d Disks) ReplicationSetSchedule(ctx context.Context, req ReplicationSetScheduleRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudapi/disks/replication_set_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
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user