3 Commits

Author SHA1 Message Date
asteam
25fa57f583 v13.4.0 2026-01-16 17:05:59 +03:00
3588755461 v13.3.0 2025-12-29 14:48:59 +03:00
dayterr
a59feae2f2 v13.2.0 2025-12-23 17:49:46 +03:00
51 changed files with 273 additions and 119 deletions

View File

@@ -1,71 +1,53 @@
## Version 13.1.0
## Version 13.4.0
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях |
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях
Все методы группы `.SDN()` находятся в альфа-версии.
### Добавлено
#### account
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-686 | Поле `Policies` в структуры ответа `LimitsRG` в cloudapi/account и `Limits` в cloudbroker/account |
#### access groups
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-693 | Поле `OwnerDisplayName` в структуру запроса `ListGroupsRequest` и поле `Comment` в структуру ответа `AccessGroupItem` |
| BGOS-732 | Опциональное поле `NetMask` в структуру запроса `NetAttachRequest` в cloudapi/compute |
| BGOS-727 | Опциональное поле `Cache` в структуру запроса `DiskAddRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-727 | Поле `Cache` в структуры ответа `ItemComputeDisk` в cloudapi/compute и в `ItemDisk` в cloudbroker/compute |
#### backup
#### disks
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-688 | Опциональное поле `NodeID` в структуры запросов `RestoreDiskFromBackupRequest` и `RestoreDisksFromBackupRequest` в cloudbroker/backup |
| BGOS-725 | Структура запроса `UpdateRequest`, метод `Update` в cloudbroker/disks |
| BGOS-725 | Опциональное поле `Cache` в структуру запроса `CreateRequest` в cloudapi/disks и в cloudbroker/disks |
| BGOS-725 | Поле `Cache` в структуру ответа `InfoDisk` в cloudbroker/disks |
| BGOS-725 | Поле `Cache` в структуры ответа `RecordDisk`,`ItemDisk` в cloudapi/disks |
#### node
#### kvmx86
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-691 | Поле `UsableCPUs` в структурах ответа `RecordNode` и `ItemNode` в cloudbroker/node |
#### storage policy
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-690 | Поле `SepTechStatus` в структуру `AccessSEPPool` в структуре ответа `ItemStoragePolicy` в cloudapi/stpolicy и в cloudbroker/stpolicy |
#### user
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-692 | Поле `SortBy` в структуру запроса `GetAuditRequest` в cloudbroker/user |
| --- | --- |
| BGOS-727 | Опциональное поле `BootDiskCache` в структуры запроса `CreateRequest`, `CreateBlankRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
| BGOS-727 | Опциональное поле `BootDiskCache` в структуру запроса `MassCreateRequest` в cloudbroker/kvmx86 |
### Изменено
#### user
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-700 | Изменен тип поля `EmailAddress` с `[]string` на `string` в структуре запроса `CreateRequest` в cloudbroker/user |
| BGOS-700 | Изменен тип возвращаемого значения метода `Create` с `bool` на `string` в cloudbroker/user |
### Удалено
#### account
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-686 | Поле `CUNP` из структуры ответа `ResourceLimits` в cloudapi/account и cloudbroker/account |
| BGOS-686 | Поле `ExtTraffic` из структур ответа `Resource` и `LimitsRG` в cloudapi/account и `Resource` и `Limits` в cloudbroker/account |
#### grid
#### bservice
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-686 | Поле `ExtTraffic` из структуры ответа `RecordResource` в cloudbroker/grid |
| BGOS-728 | Тип полей `Chipset` и `Mode` с обязательного на опциональный в структуре запроса `GroupResizeRequest` в cloudapi/bservice и в cloudbroker/bservice |
#### rg
#### lb
| Идентификатор<br>задачи | Описание |
| --- | ---|
| BGOS-686 | Поле `ExtTraffic` из структур ответа `Resource` и `RecordResourceUsage` в cloudapi/rg и `Reservation` в cloudbroker/rg |
| --- | --- |
| BGOS-733 | Тип поля `Start` с обязательного на опциональный в структуре запроса `CreateRequest`в cloudapi/lb и в cloudbroker/lb |
#### trunk
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-730 | Тип полей `Name` и `TrunkTags` с обязательного на опциональный в структуре запроса `UpdateRequest` в cloudbroker/trunk |
#### user
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-686 | Поле `ExtTraffic` из структуры ответа `Resources` в cloudapi/user |
| BGOS-729 | Тип поля `Limit` с обязательного на опциональный в структуре запроса `GetMatchingUsernamesRequest` в cloudbroker/user |

View File

@@ -471,3 +471,10 @@ func addressPoolNetTypeValidator(fe validator.FieldLevel) bool {
return IsInSlice(fieldValue, addressPoolNetTypeValues)
}
// sepTechStatusValidator is used to validate SepTechStatus fields
func sepTechStatusValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
return IsInSlice(fieldValue, sepTechStatusValues)
}

View File

@@ -366,6 +366,12 @@ func errorMessage(fe validator.FieldError) string {
prefix,
fe.Field(),
joinValues(ipTypeValues))
case "sepTechStatus":
return fmt.Sprintf("%s %s must be one of the following: %s",
prefix,
fe.Field(),
joinValues(sepTechStatusValues))
}
return fe.Error()

View File

@@ -311,5 +311,10 @@ func registerAllValidators(validate *validator.Validate) error {
return err
}
err = validate.RegisterValidation("sepTechStatus", sepTechStatusValidator)
if err != nil {
return err
}
return nil
}

View File

@@ -66,7 +66,7 @@ var (
loaderTypeValues = []string{"linux", "windows", "unknown"}
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des"}
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des", "ustor"}
languageValues = []string{"ru", "en"}
@@ -81,6 +81,8 @@ var (
addressPoolNetTypeValues = []string{"IPv4", "IPv6", "MAC"}
ipTypeValues = []string{"v4, v6"}
sepTechStatusValues = []string{"ENABLED", "DISABLED"}
)
const (

View File

@@ -25,15 +25,15 @@ type GroupResizeRequest struct {
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
// Available values : i440fx, Q35
// Default value : Q35
// Required: true
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
// Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
// Either delta or absolute value of computes
// Should be one of:
// - ABSOLUTE
// - RELATIVE
// Required: true
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
// Required: false
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
}
// GroupResize resize the group by changing the number of computes

View File

@@ -38,9 +38,8 @@ type AffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AffinityRuleAdd add affinity rule

View File

@@ -38,9 +38,8 @@ type AffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AffinityRuleRemove remove affinity rule

View File

@@ -38,9 +38,8 @@ type AntiAffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AntiAffinityRuleAdd add anti affinity rule

View File

@@ -38,9 +38,8 @@ type AntiAffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AntiAffinityRuleRemove remove anti affinity rule

View File

@@ -58,6 +58,10 @@ type DiskAddRequest struct {
// Desired bus number (hex string, e.g. "0x03")
// Required: false
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
// Disk cache mode
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
}
// DiskAdd creates new disk and attach to compute

View File

@@ -795,6 +795,9 @@ type ItemComputeDisk struct {
// Bus number
BusNumber uint64 `json:"bus_number"`
// Chache
Cache string `json:"cache"`
// Created by
CreatedBy string `json:"createdBy"`
@@ -1237,6 +1240,9 @@ type ListInfoDisks []InfoDisk
type InfoDisk struct {
// ID
ID uint64 `json:"id"`
// SEP ID
SepID int64 `json:"sepId"`
}
// List information about computes

View File

@@ -45,6 +45,11 @@ type NetAttachRequest struct {
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// Unique identifier of logical port on SDN side
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`

View File

@@ -37,6 +37,10 @@ type CreateRequest struct {
// Pool name to create disk
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Cache mode of disk
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
}
// Create creates a disk

View File

@@ -139,6 +139,9 @@ type ItemDisk struct {
// Updated by
UpdatedBy string `json:"updatedBy"`
// Cache mode of disk
Cache string `json:"cache"`
}
type ItemDiskUnattached struct {
@@ -503,6 +506,9 @@ type RecordDisk struct {
// Updated by
UpdatedBy string `json:"updatedBy"`
// Cache mode of disk
Cache string `json:"cache"`
}
type ItemReplication struct {

View File

@@ -35,6 +35,11 @@ type Interface struct {
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// MAC address to assign to this VM when connecting to the specified network
// Required: false
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
@@ -204,6 +209,10 @@ type CreateRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
}
// GetRAM returns RAM field values

View File

@@ -115,6 +115,10 @@ type CreateBlankRequest struct {
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
}
// GetRAM returns RAM field values

View File

@@ -38,8 +38,8 @@ type CreateRequest struct {
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
// Start now Load balancer
// Required: true
Start bool `url:"start" json:"start" validate:"required"`
// Required: false
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
// Text description of this load balancer
// Required: false

View File

@@ -56,6 +56,10 @@ type ListRequest struct {
// Search by pool name
// Required: false
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
// Filter SEP's by tech status (ENABLED, DISABLED)
// Required: false
SepTechStatus string `url:"sep_tech_status,omitempty" json:"sep_tech_status,omitempty" validate:"omitempty,sepTechStatus"`
}
// List gets list of storage policies as a ListStoragePolicies struct

View File

@@ -29,6 +29,9 @@ type ItemTrunk struct {
// MAC
MAC string `json:"mac"`
// MTU
MTU uint64 `json:"mtu"`
// Name of a trunk
Name string `json:"name"`

View File

@@ -95,6 +95,15 @@ type RecordAudit struct {
// TTL
TTL string `json:"_ttl"`
// Resgroup ID
ResgroupID uint64 `json:"resgroup_id"`
// Account ID
AccountID uint64 `json:"account_id"`
// Compute ID
ComputeID uint64 `json:"compute_id"`
}
// List of Linked Jobs

View File

@@ -22,18 +22,18 @@ type GroupResizeRequest struct {
// Required: true
Count int64 `url:"count" json:"count" validate:"required"`
//Chipset for new computes, either i440fx or Q35 (i440fx by default)
//Available values : i440fx, Q35
//Default value : Q35
//Required: true
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
// Available values : i440fx, Q35
// Default value : Q35
// Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
// Either delta or absolute value of computes
// Should be one of:
// - ABSOLUTE
// - RELATIVE
// Required: true
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
// Required: false
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
}
// GroupResize resize the group by changing the number of computes

View File

@@ -40,9 +40,8 @@ type AffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AffinityRuleAdd adds affinity rule

View File

@@ -38,9 +38,8 @@ type AffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AffinityRuleRemove remove affinity rule

View File

@@ -38,9 +38,8 @@ type AntiAffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AntiAffinityRuleAdd adds anti affinity rule

View File

@@ -38,9 +38,8 @@ type AntiAffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
// Required: true
Value string `url:"value" json:"value" validate:"required"`
}
// AntiAffinityRuleRemove removes anti affinity rule

View File

@@ -12,7 +12,7 @@ import (
type GetCloneStatusRequest struct {
// ID of compute instance
// Required: true
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
ComputeID string `url:"compute_id" json:"compute_id" validate:"required"`
}
// GetCloneStatus gets information about compute clone status as a RecordCloneStatus struct

View File

@@ -58,6 +58,10 @@ type DiskAddRequest struct {
// Desired bus number (hex string, e.g. "0x03")
// Required: false
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
// Disk cache mode
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
}
// DiskAdd creates new disk and attach to compute

View File

@@ -397,6 +397,9 @@ type ItemDisk struct {
// Bus number
BusNumber uint64 `json:"bus_number"`
// Chache
Cache string `json:"cache"`
// Created by
CreatedBy string `json:"createdBy"`
@@ -841,7 +844,7 @@ type InfoCompute struct {
SnapSets ListSnapshots `json:"snapSets"`
// Node ID
NodeID uint64 `json:"nodeId"`
NodeID uint64 `json:"node_id"`
// Node name
NodeName string `json:"nodeName"`
@@ -1171,6 +1174,9 @@ type RecordCompute struct {
// Zone ID
ZoneID uint64 `json:"zoneId"`
//todo
_ uint64 `json:"nodeId"`
}
type LoaderMetaIso struct {
@@ -1280,6 +1286,9 @@ type ItemDeletedCompute struct {
type InfoDisk struct {
// ID
ID uint64 `json:"id"`
// SEP ID
SepID int64 `json:"sepId"`
}
// List computes

View File

@@ -45,6 +45,11 @@ type NetAttachRequest struct {
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// Unique identifier of logical port on SDN side
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`

View File

@@ -20,7 +20,7 @@ type StartRequest struct {
// ID of node to start compute
// Required: false
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
}
// Start starts compute

View File

@@ -33,7 +33,11 @@ type StartMigrationOutRequest struct {
// Mapping of guest disk target names to absolute paths on the destination host.
// Required: false
Diskmap map[string]string `url:"diskmap,omitempty" json:"diskmap,omitempty"`
DiskMap map[string]string `url:"diskmap,omitempty" json:"diskmap,omitempty"`
// Mapping of network interfaces
// Required: false
NetMap map[string]string `url:"netmap,omitempty" json:"netmap,omitempty"`
// Mapping for CD/DVD devices or their source paths to new ISO/device paths on the destination
// Required: false

View File

@@ -37,6 +37,10 @@ type CreateRequest struct {
// Pool name to create disk
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Cache mode of disk
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
}
// Create creates a disk

View File

@@ -187,6 +187,9 @@ type InfoDisk struct {
// Updated by
UpdatedBy string `json:"updatedBy"`
// Cache mode of disk
Cache string `json:"cache"`
}
type ItemReplication struct {

View File

@@ -0,0 +1,42 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
)
// UpdateRequest struct to update disk
type UpdateRequest struct {
// ID of the disk to update
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
// Cache mode of disk
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
}
// Update updates disk
func (d Disks) Update(ctx context.Context, req UpdateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/update"
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

@@ -15,8 +15,8 @@ type PurgeLogsRequest struct {
GID uint64 `url:"gid" json:"gid" validate:"required"`
// Age of the records to remove, e.g. -1h for records older than 1 hour, -1w - one week, etc
// Required: true
Age string `url:"age" json:"age" validate:"required"`
// Required: false
Age string `url:"age,omitempty" json:"age,omitempty"`
}
// PurgeLogs clear Log and ECO records that are older than the specified age.

View File

@@ -37,6 +37,11 @@ type Interface struct {
// Required: false
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// SDN interface id
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty"`
@@ -206,6 +211,10 @@ type CreateRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
}
// GetRAM returns RAM field values

View File

@@ -115,6 +115,10 @@ type CreateBlankRequest struct {
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
}
// GetRAM returns RAM field values

View File

@@ -132,6 +132,10 @@ type MassCreateRequest struct {
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
}
type asyncWrapperMassCreateRequest struct {

View File

@@ -30,8 +30,8 @@ type CreateRequest struct {
VINSID uint64 `url:"vinsId" json:"vinsId"`
// Start now Load balancer
// Required: true
Start bool `url:"start" json:"start" validate:"required"`
// Required: false
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
// Custom sysctl values for Load Balancer instance. Applied on boot
// Required: false

View File

@@ -5,13 +5,14 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
)
type VFParam struct {
// Number of VF to assign
// ID of the FN
// Required: true
VFNum uint64 `url:"vfNum" json:"vfNum" validate:"required"`
FNID uint64 `url:"fnId" json:"fnId" validate:"required"`
// Trust
// Required: true
@@ -46,7 +47,7 @@ func (n Node) SetVFsParams(ctx context.Context, req SetVFsParamsRequest) (bool,
url := "/cloudbroker/node/setVFsParams"
res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req)
res, err := n.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err

View File

@@ -20,22 +20,22 @@ type AddConsumerNodesRequest struct {
}
// AddConsumerNodes adds consumer nodes to SEP parameters
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (bool, error) {
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/addConsumerNodes"
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
return 0, err
}
result, err := strconv.ParseBool(string(res))
result, err := strconv.ParseUint(string(res), 10, 64)
if err != nil {
return false, err
return 0, err
}
return result, nil

View File

@@ -20,22 +20,22 @@ type AddProviderNodesRequest struct {
}
// AddProviderNodes adds provider nodes to SEP parameters
func (s SEP) AddProviderNodes(ctx context.Context, req AddProviderNodesRequest) (bool, error) {
func (s SEP) AddProviderNodes(ctx context.Context, req AddProviderNodesRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/addProviderNodes"
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
return 0, err
}
result, err := strconv.ParseBool(string(res))
result, err := strconv.ParseUint(string(res), 10, 64)
if err != nil {
return false, err
return 0, err
}
return result, nil

View File

@@ -20,7 +20,7 @@ type CreateRequest struct {
// Type of storage
// Required: true
SEPType string `url:"sep_type" json:"sep_type" validate:"required"`
SEPType string `url:"sep_type" json:"sep_type" validate:"required,sepType"`
// SEP config
// Required: true
@@ -30,14 +30,6 @@ type CreateRequest struct {
// Required: false
Description string `url:"description,omitempty" json:"description,omitempty"`
// List of provider node IDs
// Required: false
ProviderNIDs []uint64 `url:"provider_nids,omitempty" json:"provider_nids,omitempty"`
// List of consumer node IDs
// Required: false
ConsumerNIDs []uint64 `url:"consumer_nids,omitempty" json:"consumer_nids,omitempty"`
// Enable SEP after creation
// Required: false
Enable bool `url:"enable,omitempty" json:"enable,omitempty"`

View File

@@ -42,6 +42,9 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Sort by SEP IDs
SepIDs []uint64 `url:"sep_ids,omitempty" json:"sep_ids,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`

View File

@@ -56,6 +56,10 @@ type ListRequest struct {
// Search by pool name
// Required: false
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
// Filter SEP's by tech status (ENABLED, DISABLED)
// Required: false
SepTechStatus string `url:"sep_tech_status,omitempty" json:"sep_tech_status,omitempty" validate:"omitempty,sepTechStatus"`
}
// List gets list of storage policies as a ListStoragePolicies struct

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
)
@@ -13,6 +14,10 @@ type UpdateRequest struct {
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// List of storage endpoint access objects
// Required: false
AccessSEPsPools []AccessSEPsPool `url:"access_seps_pools,omitempty" json:"access_seps_pools,omitempty"`
// New name for the storage policy
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
@@ -51,6 +56,6 @@ func (sp StPolicy) UpdateRaw(ctx context.Context, req UpdateRequest) ([]byte, er
url := "/cloudbroker/storage_policy/update"
res, err := sp.client.DecortApiCall(ctx, http.MethodPost, url, req)
res, err := sp.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
return res, err
}

View File

@@ -33,6 +33,11 @@ type CreateRequest struct {
// Native VLAN ID
// Required: false
NativeVLANID uint64 `url:"native_vlan_id,omitempty" json:"native_vlan_id,omitempty"`
// MTU
// Default value: 1500
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty"`
}
// Create creates a user.

View File

@@ -29,6 +29,9 @@ type ItemTrunk struct {
// MAC
MAC string `json:"mac"`
// MTU
MTU uint64 `json:"mtu"`
// Name of a trunk
Name string `json:"name"`

View File

@@ -15,12 +15,12 @@ type UpdateRequest struct {
TrunkID uint64 `url:"id" json:"id" validate:"required"`
// New name of the trunk
// Required: true
Name string `url:"name" json:"name" validate:"required"`
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
// List of trunk tags (values between 1-4095)
// Required: true
TrunkTags string `url:"trunk_tags" json:"trunk_tags" validate:"required,trunkTags"`
// Required: false
TrunkTags string `url:"trunk_tags,omitempty" json:"trunk_tags,omitempty" validate:"omitempty,trunkTags"`
// New description of the trunk
// Required: false
@@ -29,6 +29,11 @@ type UpdateRequest struct {
// New native VLAN ID
// Required: false
NativeVLANID uint64 `url:"native_vlan_id,omitempty" json:"native_vlan_id,omitempty"`
// MTU
// Default value: 1500
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty"`
}
// Update updates a trunk

View File

@@ -15,8 +15,8 @@ type GetMatchingUsernamesRequest struct {
UsernameRegex string `url:"usernameregex" json:"usernameregex" validate:"required"`
// The number of usernames to return.
// Required: true
Limit uint64 `url:"limit" json:"limit" validate:"required"`
// Required: false
Limit uint64 `url:"limit,omitempty" json:"limit,omitempty"`
}
// GetMatchingUsernames gets a list of the matching usernames for a given string.