This commit is contained in:
dayterr
2026-02-27 17:02:27 +03:00
parent b834e5d074
commit c2c810504d
34 changed files with 118 additions and 268 deletions

View File

@@ -1,4 +1,4 @@
## Version 1.14.0 ## Version 1.14.1
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
@@ -12,38 +12,59 @@
#### account #### account
| Идентификатор<br>задачи | Описание | | Идентификатор<br>задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-772 | Вычисляемое поле `UpdatedBy` в структуры ответа `RecordAccount` в cloudapi/account и `InfoAccount` в cloudbroker/account | | BGOS-780 | Вычисляемое поле `DeletedBy` в структуру ответа `ItemAccount` в cloudapi/account |
#### compute #### compute
| Идентификатор<br>задачи | Описание | | Идентификатор<br>задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-767 | Метод `CheckComputePlacement`, структура запроса `CheckComputePlacementRequest` и структуры ответа `CheckComputePlacementResult`, `CheckComputePlacementItem`,`CheckComputePlacementError` в cloudbroker/compute | | BGOS-777 | Структура ответа `RecordCloneAbort` в cloudbroker/compute |
| BGOS-771 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk` в cloudbroker/compute и в `ItemComputeDisk` в cloudapi/compute | | BGOS-774 | Опциональное поле `Weight` в структуру запроса `UpdateRequest` в cloudbroker/compute |
| BGOS-774 | Вычисляемое поле `Weight` в структуры ответа `InfoCompute` и `RecordCompute` в cloudbroker/compute и в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute |
#### kvmx86
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-775 | Опциональное поле `Weight` в структуры запроса `CreateRequest`, `CreateBlankRequest` и `MassCreateRequest` в cloudbroker/kvmx86 |
#### rg
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-776 | Вычисляемое поле `Email` в структуры ответа `ItemACL` в cloudapi/rg и в `ACL` в cloudbroker/rg |
| BGOS-779 | Опциональные поля `RGID` и `ComputeID` в структуру запроса `ListRequest` в cloudapi/rg и в cloudbroker/rg |
#### stpolicy
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-784 | Вычисляемое поле `Usage` в структуру ответа `InfoStoragePolicyWithID` в cloudbroker/stpolicy |
### Изменено
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-777 | Тип возвращаемого значения метода `CloneAbort` с `bool` на `[]RecordCloneAbort` в cloudbroker/compute |
### Удалено
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-781 | Опциональное поле `DiskType` из структур `DiskAddRequest` и `DiskAttachRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-785 | Вычисляемое поле `Type` из структур `ItemDisk`, `RecordDisk` и `ItemDiskUnattached` в cloudapi/compute и из структуры `InfoDisk` в cloudbroker/compute |
#### disks #### disks
| Идентификатор<br>задачи | Описание | | Идентификатор<br>задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-770 | Опциональное поле `BlockSize` в структуру запроса `UpdateRequest` в cloudbroker/disks | | BGOS-781 | Структура запросов `ListTypesRequest`, структура ответов `ListTypes`, метод `ListTypes` в cloudapi/disks и в cloudbroker/disks |
| BGOS-770 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk`, `ItemDiskUnattached` и `RecordDisk` в cloudapi/disks и в структуры ответа `InfoDisk` и `RecordDisk` в cloudbroker/disks | | BGOS-781 | Опциональное поле `Type` из структур `ListRequest`, `ListDeletedRequest` и `ListUnattachedRequest` в cloudapi/disks и в cloudbroker/disks |
#### node
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-769 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudbroker/node |
#### SDN external networks
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-694 | Опциональные поля `OperationStatus` и `HypervisorStatus` в структуру запроса `ListRequest` в sdn/external_networks |
#### SDN network object groups
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-749 | Методы `AttachL2ConnectionPorts`, `DetachL2ConnectionPorts` и структуры запросов `AttachL2ConnectionPortsRequest`, `L2PortBindings`, `DetachL2PortBindings`, `DetachL2ConnectionPortsRequest` в sdn/netobjgroups |
### Удалено
#### kvmx86 #### kvmx86
| Идентификатор<br>задачи | Описание | | Идентификатор<br>задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-773 | Опциональные поля `IS` и `IPAType` из структур запроса `CreateRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 | | BGOS-773 | Опциональные поля `IS` и `IPAType` из структур запроса `CreateRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
#### stpolicy
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-784 | Вычисляемое поле `StoragePolicyID` из структуры ответа `InfoStoragePolicyWithID` в cloudbroker/stpolicy |

View File

@@ -467,16 +467,6 @@ type CreateRequest struct {
// Node ID // Node ID
// Required: false // Required: false
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"` NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
// System name
// Required: false
IS string `url:"IS,omitempty" json:"IS,omitempty"`
// Compute purpose
// Required: false
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
} }
``` ```

View File

@@ -86,13 +86,6 @@ func computeModeValidator(fe validator.FieldLevel) bool {
return IsInSlice(fieldValue, computeModeValues) return IsInSlice(fieldValue, computeModeValues)
} }
// computeDiskTypeValidator is used to validate DiskType field.
func computeDiskTypeValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
return IsInSlice(fieldValue, computeDiskTypeValues)
}
// computeNetTypeValidator is used to validate NetType field. // computeNetTypeValidator is used to validate NetType field.
func computeNetTypeValidator(fe validator.FieldLevel) bool { func computeNetTypeValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String() fieldValue := fe.Field().String()
@@ -151,13 +144,6 @@ func computeDataDisksValidator(fe validator.FieldLevel) bool {
return IsInSlice(fieldValue, computeDataDisksValues) return IsInSlice(fieldValue, computeDataDisksValues)
} }
// diskTypeValidator is used to validate Type field.
func diskTypeValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
return IsInSlice(fieldValue, diskTypeValues)
}
// flipgroupClientTypeValidator is used to validate ClientType field. // flipgroupClientTypeValidator is used to validate ClientType field.
func flipgroupClientTypeValidator(fe validator.FieldLevel) bool { func flipgroupClientTypeValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String() fieldValue := fe.Field().String()

View File

@@ -86,12 +86,6 @@ func errorMessage(fe validator.FieldError) string {
fe.Field(), fe.Field(),
joinValues(computeModeValues)) joinValues(computeModeValues))
case "computeDiskType":
return fmt.Sprintf("%s %s must be one of the following: %s",
prefix,
fe.Field(),
joinValues(computeDiskTypeValues))
case "mtu": case "mtu":
return fmt.Sprint(prefix, fe.Field(), "must be ", mtuMin, "-", mtuMax) return fmt.Sprint(prefix, fe.Field(), "must be ", mtuMin, "-", mtuMax)
@@ -122,13 +116,6 @@ func errorMessage(fe validator.FieldError) string {
fe.Field(), fe.Field(),
joinValues(computeDataDisksValues)) joinValues(computeDataDisksValues))
// Disk Validators
case "diskType":
return fmt.Sprintf("%s %s must be one of the following: %s",
prefix,
fe.Field(),
joinValues(diskTypeValues))
// Flipgroup Validators // Flipgroup Validators
case "flipgroupClientType": case "flipgroupClientType":
return fmt.Sprintf("%s %s must be one of the following: %s", return fmt.Sprintf("%s %s must be one of the following: %s",

View File

@@ -86,11 +86,6 @@ func registerAllValidators(validate *validator.Validate) error {
return err return err
} }
err = validate.RegisterValidation("computeDiskType", computeDiskTypeValidator)
if err != nil {
return err
}
err = validate.RegisterValidation("computeNetType", computeNetTypeValidator) err = validate.RegisterValidation("computeNetType", computeNetTypeValidator)
if err != nil { if err != nil {
return err return err
@@ -111,11 +106,6 @@ func registerAllValidators(validate *validator.Validate) error {
return err return err
} }
err = validate.RegisterValidation("diskType", diskTypeValidator)
if err != nil {
return err
}
err = validate.RegisterValidation("flipgroupClientType", flipgroupClientTypeValidator) err = validate.RegisterValidation("flipgroupClientType", flipgroupClientTypeValidator)
if err != nil { if err != nil {
return err return err

View File

@@ -14,14 +14,11 @@ var (
computeTopologyValues = []string{"compute", "node"} computeTopologyValues = []string{"compute", "node"}
computePolicyValues = []string{"RECOMMENDED", "REQUIRED"} computePolicyValues = []string{"RECOMMENDED", "REQUIRED"}
computeModeValues = []string{"EQ", "EN", "ANY"} computeModeValues = []string{"EQ", "EN", "ANY"}
computeDiskTypeValues = []string{"D", "B"}
computeNetTypeValues = []string{"EXTNET", "VINS"} computeNetTypeValues = []string{"EXTNET", "VINS"}
computex86NetTypeValues = []string{"EXTNET", "VINS", "VFNIC", "DPDK", "SDN", "EMPTY", "TRUNK"} computex86NetTypeValues = []string{"EXTNET", "VINS", "VFNIC", "DPDK", "SDN", "EMPTY", "TRUNK"}
computeOrderValues = []string{"cdrom", "network", "hd"} computeOrderValues = []string{"cdrom", "network", "hd"}
computeDataDisksValues = []string{"KEEP", "DETACH", "DESTROY"} computeDataDisksValues = []string{"KEEP", "DETACH", "DESTROY"}
diskTypeValues = []string{"B", "T", "D"}
flipgroupClientTypeValues = []string{"compute", "vins"} flipgroupClientTypeValues = []string{"compute", "vins"}
massCreateNetTypeValues = []string{"EXTNET", "VINS", "TRUNK"} massCreateNetTypeValues = []string{"EXTNET", "VINS", "TRUNK"}

View File

@@ -95,6 +95,9 @@ type ItemAccount struct {
// Deleted time // Deleted time
DeletedTime uint64 `json:"deletedTime"` DeletedTime uint64 `json:"deletedTime"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Description // Description
Description string `json:"desc"` Description string `json:"desc"`

View File

@@ -26,13 +26,6 @@ type DiskAddRequest struct {
// Required: true // Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"` StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Type of the disk
// Should be one of:
// - D
// - B
// Required: false
DiskType string `url:"diskType,omitempty" json:"diskType,omitempty" validate:"omitempty,computeDiskType"`
// Storage endpoint provider ID // Storage endpoint provider ID
// By default the same with boot disk // By default the same with boot disk
// Required: false // Required: false

View File

@@ -18,10 +18,6 @@ type DiskAttachRequest struct {
// Required: true // Required: true
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"` DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
// Type of the disk B;D
// Required: false
DiskType string `url:"diskType,omitempty" json:"diskType,omitempty" validate:"omitempty,computeDiskType"`
// Desired PCI slot (hex string, e.g. "0x1A") // Desired PCI slot (hex string, e.g. "0x1A")
// Required: false // Required: false
PCISlot string `url:"pci_slot,omitempty" json:"pci_slot,omitempty"` PCISlot string `url:"pci_slot,omitempty" json:"pci_slot,omitempty"`

View File

@@ -545,6 +545,9 @@ type RecordCompute struct {
// VNC password // VNC password
VNCPassword string `json:"vncPasswd"` VNCPassword string `json:"vncPasswd"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID // Zone ID
// Required: false // Required: false
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
@@ -1235,6 +1238,9 @@ type ItemCompute struct {
// VINS connected // VINS connected
VINSConnected uint64 `json:"vinsConnected"` VINSConnected uint64 `json:"vinsConnected"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID // Zone ID
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
} }

View File

@@ -48,7 +48,6 @@ var disks = ListDisks{
Snapshots: []ItemSnapshot{}, Snapshots: []ItemSnapshot{},
Status: "ASSIGNED", Status: "ASSIGNED",
TechStatus: techStatusAllocated, TechStatus: techStatusAllocated,
Type: "B",
VMID: 48500, VMID: 48500,
}, },
{ {
@@ -92,7 +91,6 @@ var disks = ListDisks{
Snapshots: []ItemSnapshot{}, Snapshots: []ItemSnapshot{},
Status: "ASSIGNED", Status: "ASSIGNED",
TechStatus: techStatusAllocated, TechStatus: techStatusAllocated,
Type: "B",
VMID: 48502, VMID: 48502,
}, },
}, },
@@ -224,7 +222,6 @@ var searchDisks = ListSearchDisks{
Snapshots: []ItemSnapshot{}, Snapshots: []ItemSnapshot{},
Status: "ASSIGNED", Status: "ASSIGNED",
TechStatus: techStatusAllocated, TechStatus: techStatusAllocated,
Type: "B",
VMID: 48500, VMID: 48500,
}, },
ItemDisk{ ItemDisk{
@@ -268,7 +265,6 @@ var searchDisks = ListSearchDisks{
Snapshots: []ItemSnapshot{}, Snapshots: []ItemSnapshot{},
Status: "ASSIGNED", Status: "ASSIGNED",
TechStatus: techStatusAllocated, TechStatus: techStatusAllocated,
Type: "B",
VMID: 48502, VMID: 48502,
}, },
} }

View File

@@ -38,10 +38,6 @@ type ListRequest struct {
// Required: false // Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
// Find by sep ID // Find by sep ID
// Required: false // Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
@@ -65,6 +61,14 @@ type ListRequest struct {
// Page size // Page size
// Required: false // Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"` Size uint64 `url:"size,omitempty" json:"size,omitempty"`
// ID of the resource group
// Required: false
RGID uint64 `url:"rg_id,omitempty" json:"rg_id,omitempty"`
// ID of the compute
// Required: false
ComputeID uint64 `url:"compute_id,omitempty" json:"compute_id,omitempty"`
} }
// List gets list of the created disks belonging to an account as a ListDisks struct // List gets list of the created disks belonging to an account as a ListDisks struct

View File

@@ -34,10 +34,6 @@ type ListDeletedRequest struct {
// Required: false // Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
// Sort by one of supported fields, format +|-(field) // Sort by one of supported fields, format +|-(field)
// Required: false // Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`

View File

@@ -1,52 +0,0 @@
package disks
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ListTypesRequest struct to get list types of disks
type ListTypesRequest struct {
// Show detailed disk types by seps
// Required: true
Detailed bool `url:"detailed" json:"detailed"`
// Sort by one of supported fields, format +|-(field)
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListTypes gets list defined disk types
func (d Disks) ListTypes(ctx context.Context, req ListTypesRequest) (*ListTypes, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/listTypes"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
}
list := ListTypes{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}

View File

@@ -26,10 +26,6 @@ type ListUnattachedRequest struct {
// Required: false // Required: false
Status string `url:"status,omitempty" json:"status,omitempty"` Status string `url:"status,omitempty" json:"status,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
// ID of the account // ID of the account
// Required: false // Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

View File

@@ -134,9 +134,6 @@ type ItemDisk struct {
// Need to clean before destroy // Need to clean before destroy
ToClean bool `json:"to_clean"` ToClean bool `json:"to_clean"`
// Type
Type string `json:"type"`
// Virtual machine ID // Virtual machine ID
VMID uint64 `json:"vmid"` VMID uint64 `json:"vmid"`
@@ -283,9 +280,6 @@ type ItemDiskUnattached struct {
// Tech status // Tech status
TechStatus string `json:"techStatus"` TechStatus string `json:"techStatus"`
// Type
Type string `json:"type"`
// Virtual machine ID // Virtual machine ID
VMID uint64 `json:"vmid"` VMID uint64 `json:"vmid"`
} }
@@ -513,9 +507,6 @@ type RecordDisk struct {
// Need to clean before destroy // Need to clean before destroy
ToClean bool `json:"to_clean"` ToClean bool `json:"to_clean"`
// Type
Type string `json:"type"`
// Virtual machine ID // Virtual machine ID
VMID uint64 `json:"vmid"` VMID uint64 `json:"vmid"`
@@ -548,11 +539,3 @@ type ItemReplication struct {
// VolumeID // VolumeID
VolumeID string `json:"volumeId"` VolumeID string `json:"volumeId"`
} }
type ListTypes struct {
// Data
Data []interface{} `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}

View File

@@ -267,6 +267,9 @@ type ListResourceGroups struct {
// Main information about Access Control List // Main information about Access Control List
type ItemACL struct { type ItemACL struct {
// Email
Email string `json:"email"`
// Explicit // Explicit
Explicit bool `json:"explicit"` Explicit bool `json:"explicit"`

View File

@@ -2,8 +2,8 @@ package compute
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants" "repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators" "repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
@@ -17,22 +17,24 @@ type CloneAbortRequest struct {
} }
// CloneAbort aborts a compute clone // 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) ([]RecordCloneAbort, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return nil, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudbroker/compute/clone_abort" url := "/cloudbroker/compute/clone_abort"
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req) res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil { if err != nil {
return false, err return nil, err
} }
result, err := strconv.ParseBool(string(res)) result := make([]RecordCloneAbort, 0)
err = json.Unmarshal(res, &result)
if err != nil { if err != nil {
return false, err return nil, err
} }
return result, nil return result, nil

View File

@@ -31,13 +31,6 @@ type DiskAddRequest struct {
// Required: true // Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"` StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Type of the disk
// Should be one of:
// - D
// - B
// Required: false
DiskType string `url:"diskType,omitempty" json:"diskType,omitempty" validate:"omitempty,computeDiskType"`
// Pool name // Pool name
// By default will be chosen automatically // By default will be chosen automatically
// Required: false // Required: false

View File

@@ -18,10 +18,6 @@ type DiskAttachRequest struct {
// Required: true // Required: true
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"` DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
// Type of the disk B;D
// Required: false
DiskType string `url:"diskType,omitempty" json:"diskType,omitempty"`
// Desired PCI slot (hex string, e.g. "0x1A") // Desired PCI slot (hex string, e.g. "0x1A")
// Required: false // Required: false
PCISlot string `url:"pci_slot,omitempty" json:"pci_slot,omitempty"` PCISlot string `url:"pci_slot,omitempty" json:"pci_slot,omitempty"`

View File

@@ -891,6 +891,9 @@ type InfoCompute struct {
// VINS connected // VINS connected
VINSConnected uint64 `json:"vinsConnected"` VINSConnected uint64 `json:"vinsConnected"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID // Zone ID
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
} }
@@ -1178,6 +1181,9 @@ type RecordCompute struct {
// VNC password // VNC password
VNCPassword string `json:"vncPasswd"` VNCPassword string `json:"vncPasswd"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID // Zone ID
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
@@ -1469,6 +1475,14 @@ type MigrateStorageItem struct {
TargetNodeID uint64 `json:"targetNodeId"` TargetNodeID uint64 `json:"targetNodeId"`
} }
type RecordCloneAbort struct {
// Disk ID
DiskID uint64 `json:"disk_id"`
// Abort status
Status bool `json:"status"`
}
type RecordCloneStatus struct { type RecordCloneStatus struct {
// Disk ID // Disk ID
DiskID int `json:"disk_id"` DiskID int `json:"disk_id"`

View File

@@ -69,6 +69,10 @@ type UpdateRequest struct {
// The OS version that will be installed on the virtual machine // The OS version that will be installed on the virtual machine
// Required: false // Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"` OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Priority weight of the compute: higher value means higher priority and later migration
// Required: false
Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"`
} }
// Update updates some properties of the compute // Update updates some properties of the compute

View File

@@ -59,7 +59,6 @@ var disks = ListDisks{
Snapshots: []ItemSnapshot{}, Snapshots: []ItemSnapshot{},
Status: "ASSIGNED", Status: "ASSIGNED",
TechStatus: "ALLOCATED", TechStatus: "ALLOCATED",
Type: "B",
VMID: 48500, VMID: 48500,
}, },
}, },
@@ -120,7 +119,6 @@ var disks = ListDisks{
Snapshots: []ItemSnapshot{}, Snapshots: []ItemSnapshot{},
Status: "ASSIGNED", Status: "ASSIGNED",
TechStatus: "ALLOCATED", TechStatus: "ALLOCATED",
Type: "B",
VMID: 48502, VMID: 48502,
}, },
}, },

View File

@@ -38,10 +38,6 @@ type ListRequest struct {
// Required: false // Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
// Find by sep ID // Find by sep ID
// Required: false // Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
@@ -65,6 +61,14 @@ type ListRequest struct {
// Page size // Page size
// Required: false // Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"` Size uint64 `url:"size,omitempty" json:"size,omitempty"`
// ID of the resource group
// Required: false
RGID uint64 `url:"rg_id,omitempty" json:"rg_id,omitempty"`
// ID of the compute
// Required: false
ComputeID uint64 `url:"compute_id,omitempty" json:"compute_id,omitempty"`
} }
// List gets list of the created disks belonging to an account as a ListDisks struct // List gets list of the created disks belonging to an account as a ListDisks struct

View File

@@ -34,10 +34,6 @@ type ListDeletedRequest struct {
// Required: false // Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
// Sort by one of supported fields, format +|-(field) // Sort by one of supported fields, format +|-(field)
// Required: false // Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`

View File

@@ -1,53 +0,0 @@
package disks
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ListTypesRequest struct to get list of types of disks
type ListTypesRequest struct {
// Show detailed disk types by seps
// Required: false
Detailed bool `url:"detailed" json:"detailed"`
// Sort by one of supported fields, format +|-(field)
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListTypes gets list of defined disk types
func (d Disks) ListTypes(ctx context.Context, req ListTypesRequest) (*ListTypes, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/listTypes"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
}
list := ListTypes{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}

View File

@@ -26,10 +26,6 @@ type ListUnattachedRequest struct {
// Required: false // Required: false
Status string `url:"status,omitempty" json:"status,omitempty"` Status string `url:"status,omitempty" json:"status,omitempty"`
// Type of the disks
// Required: false
Type string `url:"type,omitempty" json:"type,omitempty"`
// ID of the account // ID of the account
// Required: false // Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

View File

@@ -185,9 +185,6 @@ type InfoDisk struct {
// Need to clean before destroy // Need to clean before destroy
ToClean bool `json:"to_clean"` ToClean bool `json:"to_clean"`
// Type
Type string `json:"type"`
// Virtual machine ID // Virtual machine ID
VMID uint64 `json:"vmid"` VMID uint64 `json:"vmid"`
@@ -322,14 +319,6 @@ type ItemSnapshot struct {
// List snapshots // List snapshots
type ListSnapshots []ItemSnapshot type ListSnapshots []ItemSnapshot
type ListTypes struct {
// Data
Data []interface{} `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
type MigrateStatus struct { type MigrateStatus struct {
// Type // Type
Type int `json:"type"` Type int `json:"type"`

View File

@@ -235,6 +235,11 @@ type CreateRequest struct {
// Boot Disk BLK Discard // Boot Disk BLK Discard
// Required: false // Required: false
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard,omitempty" json:"boot_disk_blkdiscard,omitempty" validate:"omitempty,isBool"` BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard,omitempty" json:"boot_disk_blkdiscard,omitempty" validate:"omitempty,isBool"`
// Priority weight of the VM: higher value means higher priority and later migration
// Required: false
// Default: 1
Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"`
} }
// GetRAM returns RAM field values // GetRAM returns RAM field values

View File

@@ -123,6 +123,11 @@ type CreateBlankRequest struct {
// Boot Disk BLK Discard // Boot Disk BLK Discard
// Required: false // Required: false
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"` BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"`
// Priority weight of the VM: higher value means higher priority and later migration
// Required: false
// Default: 1
Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"`
} }
// GetRAM returns RAM field values // GetRAM returns RAM field values

View File

@@ -160,6 +160,11 @@ type MassCreateRequest struct {
// Boot Disk BLK Discard // Boot Disk BLK Discard
// Required: false // Required: false
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"` BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"`
// Priority weight of the VM: higher value means higher priority and later migration
// Required: false
// Default: 1
Weight uint64 `url:"weight,omitempty" json:"weight,omitempty"`
} }
type asyncWrapperMassCreateRequest struct { type asyncWrapperMassCreateRequest struct {

View File

@@ -79,6 +79,9 @@ type ListResourceConsumption struct {
// Access Control List // Access Control List
type ACL struct { type ACL struct {
// Email
Email string `json:"email"`
// Explicit // Explicit
Explicit bool `json:"explicit"` Explicit bool `json:"explicit"`

View File

@@ -22,8 +22,8 @@ type InfoStoragePolicyWithID struct {
// Max IOPS for the sotrage policy // Max IOPS for the sotrage policy
LimitIOPS uint64 `json:"limit_iops"` LimitIOPS uint64 `json:"limit_iops"`
// ID of the storage policy // Which accounts and resource groups use the storage policy
StoragePolicyID uint64 `json:"storage_policy_id"` Usage Usage `json:"usage"`
} }
type ListStoragePolicies struct { type ListStoragePolicies struct {

View File

@@ -237,7 +237,6 @@ func getRequestsMapCloudAPI() map[string]interface{} {
"/restmachine/cloudapi/disks/limitIO": disks.LimitIORequest{}, "/restmachine/cloudapi/disks/limitIO": disks.LimitIORequest{},
"/restmachine/cloudapi/disks/list": disks.ListRequest{}, "/restmachine/cloudapi/disks/list": disks.ListRequest{},
"/restmachine/cloudapi/disks/listDeleted": disks.ListDeletedRequest{}, "/restmachine/cloudapi/disks/listDeleted": disks.ListDeletedRequest{},
"/restmachine/cloudapi/disks/listTypes": disks.ListTypesRequest{},
"/restmachine/cloudapi/disks/listUnattached": disks.ListUnattachedRequest{}, "/restmachine/cloudapi/disks/listUnattached": disks.ListUnattachedRequest{},
"/restmachine/cloudapi/disks/rename": disks.RenameRequest{}, "/restmachine/cloudapi/disks/rename": disks.RenameRequest{},
"/restmachine/cloudapi/disks/replicate": disks.ReplicateRequest{}, "/restmachine/cloudapi/disks/replicate": disks.ReplicateRequest{},
@@ -673,7 +672,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/disks/limitIO": disks_cb.LimitIORequest{}, "/restmachine/cloudbroker/disks/limitIO": disks_cb.LimitIORequest{},
"/restmachine/cloudbroker/disks/list": disks_cb.ListRequest{}, "/restmachine/cloudbroker/disks/list": disks_cb.ListRequest{},
"/restmachine/cloudbroker/disks/listDeleted": disks_cb.ListDeletedRequest{}, "/restmachine/cloudbroker/disks/listDeleted": disks_cb.ListDeletedRequest{},
"/restmachine/cloudbroker/disks/listTypes": disks_cb.ListTypesRequest{},
"/restmachine/cloudbroker/disks/listUnattached": disks_cb.ListUnattachedRequest{}, "/restmachine/cloudbroker/disks/listUnattached": disks_cb.ListUnattachedRequest{},
"/restmachine/cloudbroker/disks/rename": disks_cb.RenameRequest{}, "/restmachine/cloudbroker/disks/rename": disks_cb.RenameRequest{},
"/restmachine/cloudbroker/disks/present": disks_cb.PresentRequest{}, "/restmachine/cloudbroker/disks/present": disks_cb.PresentRequest{},