Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25fa57f583 | ||
| 3588755461 |
60
CHANGELOG.md
60
CHANGELOG.md
@@ -1,4 +1,4 @@
|
|||||||
## Version 13.2.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 с соответствующими фильтрами
|
Методы `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 и в следующих версиях будет удалён
|
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
||||||
@@ -9,49 +9,45 @@
|
|||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### audit
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | ---|
|
|
||||||
| BGOS-706 | Поля `ResgroupID`, `AccountID`, `ComputeID` в структуру ответа `RecordAudit` в cloudbroker/audit |
|
|
||||||
|
|
||||||
#### compute
|
#### compute
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-703 | Опциональное поле `NetMask` в структуру запроса `NetAttachRequest` в cloudbroker/compute |
|
| BGOS-732 | Опциональное поле `NetMask` в структуру запроса `NetAttachRequest` в cloudapi/compute |
|
||||||
| BGOS-704 | Поле `SepID` в структуру ответа `InfoDisk` в cloudapi/compute и cloudbroker/compute |
|
| BGOS-727 | Опциональное поле `Cache` в структуру запроса `DiskAddRequest` в cloudapi/compute и в cloudbroker/compute |
|
||||||
|
| BGOS-727 | Поле `Cache` в структуры ответа `ItemComputeDisk` в cloudapi/compute и в `ItemDisk` в cloudbroker/compute |
|
||||||
|
|
||||||
|
#### disks
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| 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 |
|
||||||
|
|
||||||
#### kvmx86
|
#### kvmx86
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-703 | Опциональное поле `NetMask` в структуры запросов `Interface` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
|
| BGOS-727 | Опциональное поле `BootDiskCache` в структуры запроса `CreateRequest`, `CreateBlankRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
|
||||||
|
| BGOS-727 | Опциональное поле `BootDiskCache` в структуру запроса `MassCreateRequest` в cloudbroker/kvmx86 |
|
||||||
#### sep
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | ---|
|
|
||||||
| BGOS-704 | Опциональное поле `SepIDs` в структуре запроса `ListRequest` в cloudbroker/sep |
|
|
||||||
|
|
||||||
#### storage policy
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | ---|
|
|
||||||
| BGOS-708 | Поле `SepTechStatus` в структуру запроса `ListRequest` в cloudapi/stpolicy и в cloudbroker/stpolicy |
|
|
||||||
| BGOS-710 | Обязательное поле `AccessSEPsPool` в структуру запроса `UpdateRequest` в cloudbroker/stpolicy |
|
|
||||||
|
|
||||||
#### trunk
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | ---|
|
|
||||||
| BGOS-705 | Поле `MTU` в структуру ответа `ItemTrunk` в cloudapi/trunk и в cloudbroker/trunk |
|
|
||||||
| BGOS-705 | Опциональное поле `MTU` в структуры запроса`CreateRequest` и `UpdateRequest` в cloudbroker/trunk |
|
|
||||||
|
|
||||||
### Изменено
|
### Изменено
|
||||||
|
|
||||||
#### compute
|
#### bservice
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-707 | Поле `Value` стало обязательным в структурах запроса `AntiAffinityRuleAddRequest`, `AntiAffinityRuleRemoveRequest`, `AffinityRuleAddRequest` и `AffinityRuleRemoveRequest` в cloudapi/compute и в cloudbroker/compute |
|
| BGOS-728 | Тип полей `Chipset` и `Mode` с обязательного на опциональный в структуре запроса `GroupResizeRequest` в cloudapi/bservice и в cloudbroker/bservice |
|
||||||
| BGOS-707 | Тип поля `StoragePolicyID` изменен с обязательного на опциональный в структуре запроса`CloneRequest` в cloudbroker/compute |
|
|
||||||
| BGOS-707 | Тип поля `ComputeID` с `uint64` на `string` в структуре запроса `GetCloneStatusRequest` в cloudbroker/compute |
|
|
||||||
|
|
||||||
#### node
|
#### lb
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-709 | Поле `VFNum` заменено на поле `FNID` в структуре `VFParam` в структуре запроса `SetVFsParamsRequest` в cloudbroker/node |
|
| BGOS-733 | Тип поля `Start` с обязательного на опциональный в структуре запроса `CreateRequest`в cloudapi/lb и в cloudbroker/lb |
|
||||||
|
|
||||||
|
#### trunk
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-730 | Тип полей `Name` и `TrunkTags` с обязательного на опциональный в структуре запроса `UpdateRequest` в cloudbroker/trunk |
|
||||||
|
|
||||||
|
#### user
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-729 | Тип поля `Limit` с обязательного на опциональный в структуре запроса `GetMatchingUsernamesRequest` в cloudbroker/user |
|
||||||
@@ -66,7 +66,7 @@ var (
|
|||||||
|
|
||||||
loaderTypeValues = []string{"linux", "windows", "unknown"}
|
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"}
|
languageValues = []string{"ru", "en"}
|
||||||
|
|
||||||
|
|||||||
@@ -25,15 +25,15 @@ type GroupResizeRequest struct {
|
|||||||
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
||||||
// Available values : i440fx, Q35
|
// Available values : i440fx, Q35
|
||||||
// Default value : Q35
|
// Default value : Q35
|
||||||
// Required: true
|
// Required: false
|
||||||
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - ABSOLUTE
|
// - ABSOLUTE
|
||||||
// - RELATIVE
|
// - RELATIVE
|
||||||
// Required: true
|
// Required: false
|
||||||
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
|
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupResize resize the group by changing the number of computes
|
// GroupResize resize the group by changing the number of computes
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ type DiskAddRequest struct {
|
|||||||
// Desired bus number (hex string, e.g. "0x03")
|
// Desired bus number (hex string, e.g. "0x03")
|
||||||
// Required: false
|
// Required: false
|
||||||
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
|
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
|
// DiskAdd creates new disk and attach to compute
|
||||||
|
|||||||
@@ -795,6 +795,9 @@ type ItemComputeDisk struct {
|
|||||||
// Bus number
|
// Bus number
|
||||||
BusNumber uint64 `json:"bus_number"`
|
BusNumber uint64 `json:"bus_number"`
|
||||||
|
|
||||||
|
// Chache
|
||||||
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
// Created by
|
// Created by
|
||||||
CreatedBy string `json:"createdBy"`
|
CreatedBy string `json:"createdBy"`
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ type NetAttachRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
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
|
// Unique identifier of logical port on SDN side
|
||||||
// Required: false
|
// Required: false
|
||||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ type CreateRequest struct {
|
|||||||
// Pool name to create disk
|
// Pool name to create disk
|
||||||
// Required: false
|
// Required: false
|
||||||
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
|
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
|
// Create creates a disk
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ type ItemDisk struct {
|
|||||||
|
|
||||||
// Updated by
|
// Updated by
|
||||||
UpdatedBy string `json:"updatedBy"`
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
Cache string `json:"cache"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemDiskUnattached struct {
|
type ItemDiskUnattached struct {
|
||||||
@@ -503,6 +506,9 @@ type RecordDisk struct {
|
|||||||
|
|
||||||
// Updated by
|
// Updated by
|
||||||
UpdatedBy string `json:"updatedBy"`
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
Cache string `json:"cache"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemReplication struct {
|
type ItemReplication struct {
|
||||||
|
|||||||
@@ -209,6 +209,10 @@ type CreateRequest struct {
|
|||||||
// Zone ID
|
// Zone ID
|
||||||
// Required: false
|
// Required: false
|
||||||
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
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
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -115,6 +115,10 @@ type CreateBlankRequest 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"`
|
||||||
|
|
||||||
|
// Cache mode for boot disk
|
||||||
|
// Required: false
|
||||||
|
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ type CreateRequest struct {
|
|||||||
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
|
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
|
||||||
|
|
||||||
// Start now Load balancer
|
// Start now Load balancer
|
||||||
// Required: true
|
// Required: false
|
||||||
Start bool `url:"start" json:"start" validate:"required"`
|
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
|
||||||
|
|
||||||
// Text description of this load balancer
|
// Text description of this load balancer
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -22,18 +22,18 @@ type GroupResizeRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
Count int64 `url:"count" json:"count" validate:"required"`
|
Count int64 `url:"count" json:"count" validate:"required"`
|
||||||
|
|
||||||
//Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
||||||
//Available values : i440fx, Q35
|
// Available values : i440fx, Q35
|
||||||
//Default value : Q35
|
// Default value : Q35
|
||||||
//Required: true
|
// Required: false
|
||||||
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - ABSOLUTE
|
// - ABSOLUTE
|
||||||
// - RELATIVE
|
// - RELATIVE
|
||||||
// Required: true
|
// Required: false
|
||||||
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
|
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupResize resize the group by changing the number of computes
|
// GroupResize resize the group by changing the number of computes
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ type CloneRequest struct {
|
|||||||
Name string `url:"name" json:"name" validate:"required"`
|
Name string `url:"name" json:"name" validate:"required"`
|
||||||
|
|
||||||
// ID of the Storage Policy
|
// ID of the Storage Policy
|
||||||
// Required: false
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id"`
|
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
||||||
|
|
||||||
// Timestamp of the parent's snapshot to create clone from
|
// Timestamp of the parent's snapshot to create clone from
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ type DiskAddRequest struct {
|
|||||||
// Desired bus number (hex string, e.g. "0x03")
|
// Desired bus number (hex string, e.g. "0x03")
|
||||||
// Required: false
|
// Required: false
|
||||||
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
|
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
|
// DiskAdd creates new disk and attach to compute
|
||||||
|
|||||||
@@ -397,6 +397,9 @@ type ItemDisk struct {
|
|||||||
// Bus number
|
// Bus number
|
||||||
BusNumber uint64 `json:"bus_number"`
|
BusNumber uint64 `json:"bus_number"`
|
||||||
|
|
||||||
|
// Chache
|
||||||
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
// Created by
|
// Created by
|
||||||
CreatedBy string `json:"createdBy"`
|
CreatedBy string `json:"createdBy"`
|
||||||
|
|
||||||
@@ -1173,7 +1176,7 @@ type RecordCompute struct {
|
|||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
//todo
|
//todo
|
||||||
_ uint64 `json:"nodeId"`
|
_ uint64 `json:"nodeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LoaderMetaIso struct {
|
type LoaderMetaIso struct {
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ type StartMigrationOutRequest struct {
|
|||||||
|
|
||||||
// Mapping of guest disk target names to absolute paths on the destination host.
|
// Mapping of guest disk target names to absolute paths on the destination host.
|
||||||
// Required: false
|
// 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
|
// Mapping for CD/DVD devices or their source paths to new ISO/device paths on the destination
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ type CreateRequest struct {
|
|||||||
// Pool name to create disk
|
// Pool name to create disk
|
||||||
// Required: false
|
// Required: false
|
||||||
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
|
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
|
// Create creates a disk
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ type InfoDisk struct {
|
|||||||
|
|
||||||
// Updated by
|
// Updated by
|
||||||
UpdatedBy string `json:"updatedBy"`
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
Cache string `json:"cache"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemReplication struct {
|
type ItemReplication struct {
|
||||||
|
|||||||
42
pkg/cloudbroker/disks/update.go
Normal file
42
pkg/cloudbroker/disks/update.go
Normal 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
|
||||||
|
}
|
||||||
@@ -15,8 +15,8 @@ type PurgeLogsRequest struct {
|
|||||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
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
|
// Age of the records to remove, e.g. -1h for records older than 1 hour, -1w - one week, etc
|
||||||
// Required: true
|
// Required: false
|
||||||
Age string `url:"age" json:"age" validate:"required"`
|
Age string `url:"age,omitempty" json:"age,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PurgeLogs clear Log and ECO records that are older than the specified age.
|
// PurgeLogs clear Log and ECO records that are older than the specified age.
|
||||||
|
|||||||
@@ -211,6 +211,10 @@ type CreateRequest struct {
|
|||||||
// Zone ID
|
// Zone ID
|
||||||
// Required: false
|
// Required: false
|
||||||
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
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
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -115,6 +115,10 @@ type CreateBlankRequest 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"`
|
||||||
|
|
||||||
|
// Cache mode for boot disk
|
||||||
|
// Required: false
|
||||||
|
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ type MassCreateRequest 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"`
|
||||||
|
|
||||||
|
// Cache mode for boot disk
|
||||||
|
// Required: false
|
||||||
|
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type asyncWrapperMassCreateRequest struct {
|
type asyncWrapperMassCreateRequest struct {
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ type CreateRequest struct {
|
|||||||
VINSID uint64 `url:"vinsId" json:"vinsId"`
|
VINSID uint64 `url:"vinsId" json:"vinsId"`
|
||||||
|
|
||||||
// Start now Load balancer
|
// Start now Load balancer
|
||||||
// Required: true
|
// Required: false
|
||||||
Start bool `url:"start" json:"start" validate:"required"`
|
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
|
||||||
|
|
||||||
// Custom sysctl values for Load Balancer instance. Applied on boot
|
// Custom sysctl values for Load Balancer instance. Applied on boot
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -20,22 +20,22 @@ type AddConsumerNodesRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddConsumerNodes adds consumer nodes to SEP parameters
|
// 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)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/sep/addConsumerNodes"
|
url := "/cloudbroker/sep/addConsumerNodes"
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
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 {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
@@ -20,22 +20,22 @@ type AddProviderNodesRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddProviderNodes adds provider nodes to SEP parameters
|
// 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)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/sep/addProviderNodes"
|
url := "/cloudbroker/sep/addProviderNodes"
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
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 {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Type of storage
|
// Type of storage
|
||||||
// Required: true
|
// 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
|
// SEP config
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -30,14 +30,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"description,omitempty" json:"description,omitempty"`
|
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
|
// Enable SEP after creation
|
||||||
// Required: false
|
// Required: false
|
||||||
Enable bool `url:"enable,omitempty" json:"enable,omitempty"`
|
Enable bool `url:"enable,omitempty" json:"enable,omitempty"`
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ type UpdateRequest struct {
|
|||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
||||||
|
|
||||||
// List of storage endpoint access objects
|
// List of storage endpoint access objects
|
||||||
// Required: true
|
// Required: false
|
||||||
AccessSEPsPools []AccessSEPsPool `url:"access_seps_pools" json:"access_seps_pools" validate:"required"`
|
AccessSEPsPools []AccessSEPsPool `url:"access_seps_pools,omitempty" json:"access_seps_pools,omitempty"`
|
||||||
|
|
||||||
// New name for the storage policy
|
// New name for the storage policy
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ type UpdateRequest struct {
|
|||||||
TrunkID uint64 `url:"id" json:"id" validate:"required"`
|
TrunkID uint64 `url:"id" json:"id" validate:"required"`
|
||||||
|
|
||||||
// New name of the trunk
|
// New name of the trunk
|
||||||
// Required: true
|
// Required: false
|
||||||
Name string `url:"name" json:"name" validate:"required"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
|
||||||
// List of trunk tags (values between 1-4095)
|
// List of trunk tags (values between 1-4095)
|
||||||
// Required: true
|
// Required: false
|
||||||
TrunkTags string `url:"trunk_tags" json:"trunk_tags" validate:"required,trunkTags"`
|
TrunkTags string `url:"trunk_tags,omitempty" json:"trunk_tags,omitempty" validate:"omitempty,trunkTags"`
|
||||||
|
|
||||||
// New description of the trunk
|
// New description of the trunk
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ type GetMatchingUsernamesRequest struct {
|
|||||||
UsernameRegex string `url:"usernameregex" json:"usernameregex" validate:"required"`
|
UsernameRegex string `url:"usernameregex" json:"usernameregex" validate:"required"`
|
||||||
|
|
||||||
// The number of usernames to return.
|
// The number of usernames to return.
|
||||||
// Required: true
|
// Required: false
|
||||||
Limit uint64 `url:"limit" json:"limit" validate:"required"`
|
Limit uint64 `url:"limit,omitempty" json:"limit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMatchingUsernames gets a list of the matching usernames for a given string.
|
// GetMatchingUsernames gets a list of the matching usernames for a given string.
|
||||||
|
|||||||
Reference in New Issue
Block a user