v1.14.2
This commit is contained in:
@@ -110,6 +110,9 @@ type ItemAccount struct {
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Updated by
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
|
||||
// Updated time
|
||||
UpdatedTime uint64 `json:"updatedTime"`
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
@@ -17,22 +17,24 @@ type CloneAbortRequest struct {
|
||||
}
|
||||
|
||||
// CloneAbort aborts a compute clone
|
||||
func (c Compute) CloneAbort(ctx context.Context, req CloneAbortRequest) (bool, error) {
|
||||
func (c Compute) CloneAbort(ctx context.Context, req CloneAbortRequest) (ListCloneAbort, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudapi/compute/clone_abort"
|
||||
|
||||
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
if err != nil {
|
||||
return false, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseBool(string(res))
|
||||
var result ListCloneAbort
|
||||
|
||||
err = json.Unmarshal(res, &result)
|
||||
if err != nil {
|
||||
return false, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
||||
@@ -843,6 +843,9 @@ type ItemComputeDisk struct {
|
||||
// Image ID
|
||||
ImageID uint64 `json:"imageId"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// List image IDs
|
||||
Images []uint64 `json:"images"`
|
||||
|
||||
@@ -1382,6 +1385,21 @@ type RecordCloneStatus struct {
|
||||
Status CloneStatus `json:"status"`
|
||||
}
|
||||
|
||||
// Information about aborted clone disk
|
||||
type RecordCloneAbort struct {
|
||||
// Disk ID
|
||||
DiskID uint64 `json:"disk_id"`
|
||||
|
||||
// Aborted
|
||||
Aborted bool `json:"aborted"`
|
||||
|
||||
// Blockcopy abort job ID
|
||||
BlockcopyAbortJobID string `json:"blockcopy_abort_job_id"`
|
||||
}
|
||||
|
||||
// List of aborted clone disks
|
||||
type ListCloneAbort []RecordCloneAbort
|
||||
|
||||
type CloneStatus struct {
|
||||
// Type
|
||||
Type int `json:"type"`
|
||||
|
||||
@@ -39,9 +39,8 @@ type NetAttachRequest struct {
|
||||
// Required: false
|
||||
MACAddr string `url:"mac_addr,omitempty" json:"mac_addr,omitempty"`
|
||||
|
||||
// Used only for EXTNET and DPDK
|
||||
// For DPDK must be 1-9216
|
||||
// For EXTNET must be 1500-9216
|
||||
// Used for EXTNET, TRUNK and DPDK
|
||||
// Must be 1500-9216
|
||||
// Required: false
|
||||
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
||||
|
||||
|
||||
@@ -403,7 +403,6 @@ var unattachedDisks = ListDisksUnattached{
|
||||
Snapshots: nil,
|
||||
Status: "CREATED",
|
||||
TechStatus: techStatusAllocated,
|
||||
Type: "D",
|
||||
VMID: 0,
|
||||
},
|
||||
{
|
||||
@@ -457,7 +456,6 @@ var unattachedDisks = ListDisksUnattached{
|
||||
Snapshots: nil,
|
||||
Status: "CREATED",
|
||||
TechStatus: techStatusAllocated,
|
||||
Type: "B",
|
||||
VMID: 0,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -50,6 +50,9 @@ type ItemDisk struct {
|
||||
// Image ID
|
||||
ImageID uint64 `json:"imageId"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// List of image IDs
|
||||
Images []uint64 `json:"images"`
|
||||
|
||||
@@ -280,6 +283,12 @@ type ItemDiskUnattached struct {
|
||||
// Tech status
|
||||
TechStatus string `json:"techStatus"`
|
||||
|
||||
// Need to clean before destroy
|
||||
ToClean bool `json:"to_clean"`
|
||||
|
||||
// ID of the Storage Policy
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
|
||||
// Virtual machine ID
|
||||
VMID uint64 `json:"vmid"`
|
||||
}
|
||||
@@ -423,6 +432,9 @@ type RecordDisk struct {
|
||||
// Image ID
|
||||
ImageID uint64 `json:"imageId"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// List of image IDs
|
||||
Images []uint64 `json:"images"`
|
||||
|
||||
|
||||
@@ -140,6 +140,9 @@ type RecordImage struct {
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// Last modified
|
||||
LastModified uint64 `json:"lastModified"`
|
||||
|
||||
|
||||
@@ -64,6 +64,10 @@ type UpdateRequest struct {
|
||||
// Default zone ID
|
||||
// Required: false
|
||||
DefaultZoneID uint64 `url:"defaultZoneId,omitempty" json:"defaultZoneId,omitempty"`
|
||||
|
||||
// CPU allocation parameter
|
||||
// Required: false
|
||||
CpuAllocationParameter string `url:"cpu_allocation_parameter,omitempty" json:"cpu_allocation_parameter,omitempty"`
|
||||
}
|
||||
|
||||
// Update updates an account name and resource types and limits
|
||||
|
||||
@@ -442,6 +442,9 @@ type ItemDisk struct {
|
||||
// Image ID
|
||||
ImageID uint64 `json:"imageId"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// List image IDs
|
||||
Images []uint64 `json:"images"`
|
||||
|
||||
@@ -1479,8 +1482,11 @@ type RecordCloneAbort struct {
|
||||
// Disk ID
|
||||
DiskID uint64 `json:"disk_id"`
|
||||
|
||||
// Abort status
|
||||
Status bool `json:"status"`
|
||||
// Aborted
|
||||
Aborted bool `json:"aborted"`
|
||||
|
||||
// Blockcopy abort job ID
|
||||
BlockcopyAbortJobID string `json:"blockcopy_abort_job_id"`
|
||||
}
|
||||
|
||||
type RecordCloneStatus struct {
|
||||
|
||||
@@ -39,9 +39,8 @@ type NetAttachRequest struct {
|
||||
// Required: false
|
||||
MACAddr string `url:"mac_addr,omitempty" json:"mac_addr,omitempty"`
|
||||
|
||||
// Used only for EXTNET and DPDK
|
||||
// For DPDK must be 1-9216
|
||||
// For EXTNET must be 1500-9216
|
||||
// Used for EXTNET, TRUNK and DPDK
|
||||
// Must be 1500-9216
|
||||
// Required: false
|
||||
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
||||
|
||||
|
||||
@@ -242,6 +242,9 @@ type RecordDisk struct {
|
||||
// Main information about disk
|
||||
InfoDisk
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
//Updated by
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
|
||||
|
||||
@@ -53,6 +53,9 @@ type RecordImage struct {
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// Last modified
|
||||
LastModified uint64 `json:"lastModified"`
|
||||
|
||||
@@ -185,6 +188,9 @@ type ItemImage struct {
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
// Independent
|
||||
Independent bool `json:"independent"`
|
||||
|
||||
// Last modified
|
||||
LastModified uint64 `json:"lastModified"`
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ type EnableRequest struct {
|
||||
Message string `url:"message,omitempty" json:"message,omitempty"`
|
||||
|
||||
// Do not check locks, iscsi-sessions or disk-present
|
||||
// Default: true
|
||||
// Default: false
|
||||
// Required: false
|
||||
Force interface{} `url:"force" json:"force" validate:"isBool" `
|
||||
Force interface{} `url:"force" json:"force" validate:"isBool"`
|
||||
|
||||
// Reason
|
||||
// Required: false
|
||||
@@ -41,7 +41,7 @@ func (n Node) Enable(ctx context.Context, req EnableRequest) (string, error) {
|
||||
}
|
||||
|
||||
if req.Force == nil {
|
||||
req.Force = true
|
||||
req.Force = false
|
||||
}
|
||||
|
||||
reqWrapped := wrapperEnableRequest{
|
||||
@@ -67,7 +67,7 @@ func (n Node) EnableAsync(ctx context.Context, req EnableRequest) (string, error
|
||||
}
|
||||
|
||||
if req.Force == nil {
|
||||
req.Force = true
|
||||
req.Force = false
|
||||
}
|
||||
|
||||
reqWrapped := wrapperEnableRequest{
|
||||
|
||||
Reference in New Issue
Block a user