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

@@ -30,6 +30,8 @@ type wrapperDiskQOSRequest struct {
}
// DiskQOS change QoS of the disk
//
// Deprecated: will be removed in SDK v1.17
func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
@@ -57,6 +59,8 @@ func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error)
}
// DiskQOSAsync changes QoS of the disk with AsyncMode
//
// Deprecated: will be removed in SDK v1.17
func (c Compute) DiskQOSAsync(ctx context.Context, req DiskQOSRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {

View File

@@ -20,7 +20,11 @@ type DiskSwitchToReplicationRequest struct {
// Delete replication relationship
// Required: false
StopReplication bool `url:"stopReplication" json:"stopReplication"`
StopReplication bool `url:"stopReplication,omitempty" json:"stopReplication,omitempty"`
// Use planned failover for asynchronous replication
// Required: false
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
}
type wrapperDiskSwitchToReplicationRequest struct {

View File

@@ -1107,6 +1107,9 @@ type ItemComputeDisk struct {
// Created time
CreatedTime uint64 `json:"createdTime"`
// Whether CRT tracking is enabled
CRTTracking bool `json:"crt_tracking"`
// Device name
DeviceName string `json:"devicename"`

View File

@@ -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 {

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

@@ -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 {

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"`
}
// 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
}

View 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
}

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 := "/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
}

View File

@@ -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 {

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 := "/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
}

View 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
}

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

@@ -34,6 +34,14 @@ type ListRequest struct {
// Required: false
ComputeIDs []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
// Find by account access
// Required: false
AccountAccess []uint64 `url:"accountAccess,omitempty" json:"accountAccess,omitempty"`
// Find by resource group access
// Required: false
RGAccess []uint64 `url:"rgAccess,omitempty" json:"rgAccess,omitempty"`
// Sort by one of supported fields, format +|-(field)
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`

View File

@@ -34,6 +34,10 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Sort by node ID
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`

View File

@@ -42,6 +42,10 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
// Sort by name
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`

View File

@@ -54,6 +54,12 @@ type ItemVGPU struct {
// Status
Status string `json:"status"`
// Name
Name string `json:"name"`
// Node ID
NodeID uint64 `json:"node_id"`
}
// List of VGPU

View File

@@ -72,7 +72,7 @@ type CreateInAccountRequest struct {
type asyncWrapperCreateInAccountRequest struct {
CreateInAccountRequest
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// CreateInAccount creates VINS in account level

View File

@@ -66,7 +66,7 @@ type CreateInRGRequest struct {
type asyncWrapperCreateInRgRequest struct {
CreateInRGRequest
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// CreateInRG creates VINS in resource group level

View File

@@ -18,7 +18,7 @@ type EnableRequest struct {
type asyncWrapperEnableRequest struct {
EnableRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Enable enables VINS

View File

@@ -18,7 +18,7 @@ type VNFDevRedeployRequest struct {
type asyncWrapperVNFDevRedeployRequest struct {
VNFDevRedeployRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// VNFDevRedeploy redeploys VINS VNFDevs

View File

@@ -18,7 +18,7 @@ type VNFDevRestartRequest struct {
type asyncWrapperVNFDevRestartRequest struct {
VNFDevRestartRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// VNFDevRestart reboots VINSes primary VNF device