main v1.12.3
dayterr 2 months ago
parent 825b1a0a00
commit abd35f858c

@ -1,183 +1,75 @@
## Version 1.12.2
## Version 1.12.3
### Добавлено
#### общие изменения
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-525 | Поддержка работы с различными сontent-type |
| BGOS-514 | Пакет SDN со структурой для SDN запросов |
| BGOS-587 | Проверка срока действия и обновления JWT токена для `DecortClient`, в связи с добавлением срока действия токена |
#### account
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-572 | Поля `StoragePolicyIDs` в структуре ответа `RecordAccount` в cloudapi/account и в `InfoAccount` cloudbroker/account |
| BGOS-572 | Поля `StoragePolicies` в структуре ответа `ResourceLimits` в cloudapi/account и в cloudbroker/account |
| BGOS-572 | Методы `AddStoragePolicy`, `DelStoragePolicyRequest` и структуры запросов `AddStoragePolicyRequest`, `DelStoragePolicyRequest` в cloudbroker/account |
| BGOS-572 | Обязательное поле `StoragePolicies` в структуру запроса `CreateRequest` в cloudbroker/account |
| BGOS-572 | Опциональное поле `StoragePolicies` в структуру запроса `UpdateRequest` в cloudbroker/account |
| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/account и в cloudbroker/account |
#### audit
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-595 | Поле `CorrelationID` в структуры ответа `RecordAudit` в cloudapi/audit и в `RecordAudit` и `ItemAudit` в cloudbroker/audit |
#### bservice
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-576 | Опциональное поле `StoragePolicyID` в структуру запроса `GroupAddRequest` в cloudapi/bservice и в структуру запроса `GroupAddRequest` в cloudbroker/bservice |
| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/bservice и в cloudbroker/bservice |
| BGOS-606 | Поле `policies` в структуру ответа `Resource` в cloudapi/account и в cloudbroker/account |
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-569 | Опциональные поля `TimestampAT`, `TimestampTO`, `User`, `Call`, `SortBy`, `Page`, `Size`, `MinStatusCode`, `MaxStatusCode` в структуру запроса `AuditsRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-575 | Обязательное поле `StoragePolicyID` в структуру запроса `CreateTemplateFromBlankRequest`, `DiskAddRequest`, `RedeployRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-575 | Поле `StoragePolicyID` в структуру ответа `ItemComputeDisk` в cloudapi/compute и в структуру ответа `ItemDisk` в cloudbroker/compute |
| BGOS-580 | Поле `ZoneID` в структуру ответа `ItemCompute` в cloudapi/compute |
| BGOS-583 | Опциональные поля `SecGroups`, `EnableSecGroups` в структуру запроса `NetAttachRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-583 | Поля `SecGroups`, `EnableSecGroups` в структуру ответа `ItemVNFInterface` в cloudapi/compute и в `ItemInterface` cloudbroker/compute |
| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-592 | Опциональное поле `Enabled` в структуру запроса `NetAttachRequest` в cloudapi/compute и в cloudbroker/compute |
| BGOS-593 | Поле `ToClean` в структурах ответа `ItemComputeDisk` в cloudapi/compute и `ItemDisk` cloudbroker/compute |
| BGOS-603 | Поле `OSVersion` в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute и `RecordCompute` и `InfoCompute` в cloudbroker/compute |
| BGOS-603 | Опциональное поле `OSVersion` в структуры запроса `RedeployRequest` и `UpdateRequest` в cloudapi/compute и cloudbroker/compute |
| BGOS-611 | Методы `StartMigrationIN`, `StopMigrationIN`, `MigrateStorageList` и структуры запросов `StartMigrationINRequest`, `StopMigrationINRequest` и `MigrateStorageListRequest` в cloudbroker/compute |
#### disks
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-574 | Поля `StoragePolicyID` в структуры ответа `RecordDisk` и `ItemDisk` в cloudapi/disks и в `InfoDisk` cloudbroker/disks |
| BGOS-574 | Метод `ChangeDiskStoragePolicy` и структура запроса `ChangeDiskStoragePolicyRequest` в cloudapi/disks и в cloudbroker/disks |
| BGOS-574 | Обязательное поле `StoragePolicyID` в структуры запроса `CreateRequest` и `ReplicateRequest` в cloudapi/disks и в cloudbroker/disks |
| BGOS-593 | Поле `ToClean` в структурах ответа `ItemDisk`, `RecordDisk` в cloudapi/disks и `InfoDisk` cloudbroker/disks |
#### dpdknet
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-584 | Опциональное поле `EnableSecGroups` в структуру запроса `UpdateRequest` в cloudbroker/dpdknet |
| BGOS-584 | Поле `EnableSecGroups` в структуры ответа `ItemDPDKNet`, `RecordDPDKNet` в cloudapi/dpdknet и в cloudbroker/dpdknet |
#### extnet
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/extnet и в cloudbroker/extnet |
| BGOS-584 | Опциональное поле `EnableSecGroups` в структуру запроса `UpdateRequest` в cloudbroker/extnet |
| BGOS-584 | Поле `EnableSecGroups` в структуру ответа `ItemExtNet` в cloudbroker/extnet |
| BGOS-584 | Поле `EnableSecGroups` в структуру ответа `RecordExtNet` в cloudapi/extnet и в cloudbroker/extnet |
#### image
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-578 | Обязательное поле `StoragePolicyID` в структуру запроса `CreateRequest` в cloudapi/image и в структуры запроса `CreateRequest` и `CreateCDROMImageRequest` в cloudbroker/image |
| BGOS-578 | Поле `StoragePolicyID` в структуру ответа `RecordImage` в cloudapi/image и в структуры ответа `RecordImage` и `ItemImage` в cloudbroker/image |
| BGOS-578 | Метод `ChangeStoragePolicy` и структура запроса `ChangeStoragePolicyRequest` в cloudapi/image и в cloudbroker/image |
#### k8s
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-577 | Обязательное поле `StoragePolicyID` в структуры запроса `CreateRequest` и `WorkersGroupAddRequest` в cloudapi/k8s и в структуры запроса `CreateRequest` и `WorkersGroupAddRequest` в cloudbroker/k8s |
| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/k8s и в cloudbroker/k8s |
| BGOS-609 | Опциональное поле `StoragePolicyID` в структуры запроса `ListUnattachedRequest` и `ListRequest` в cloudapi/disk и cloudbroker/disk |
#### kvmx86
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-575 | Обязательное поле `StoragePolicyID` в структуры запросов `CreateRequest`, `DataDisk`, `CreateBlankRequest` в cloudapi/kvmx86 и cloudbroker/kvmx86 и `MassCreateRequest` в cloudbroker/kvmx86 |
| BGOS-583 | Опциональные поля `SecGroups`, `EnableSecGroups` в структуру запроса `Interface` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
| BGOS-592 | Опциональное поле `Enabled` в структуру запроса `Interface` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
#### lb
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/lb и в cloudbroker/lb |
| BGOS-603 | Опциональное поле `OSVersion` в структуры запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/compute и cloudbroker/compute |
| BGOS-603 | Опциональное поле `OSVersion` в структуру запроса `MassCreateRequest` в cloudbroker/compute |
#### node
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-597 | Поле `VCPU` в структуру ответа `FreeResourcesInfo` в cloudbroker/node |
#### rg
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-573 | Поля `StoragePolicyIDs` в структуре ответа `RecordResourceGroup` в cloudapi/rg и в `ItemRG` cloudbroker/rg |
| BGOS-573 | Поля `StoragePolicies` в структуре ответа `ResourceLimits` в cloudapi/rg и в cloudbroker/rg |
| BGOS-573 | Методы `AddStoragePolicy`, `DelStoragePolicyRequest` и структуры запросов `AddStoragePolicyRequest`, `DelStoragePolicyRequest` в cloudbroker/rg |
| BGOS-573 | Опциональное поле `StoragePolicies` в структуры запроса `CreateRequest`, `UpdateRequest` в cloudapi/rg и в cloudbroker/rg |
| BGOS-608 | Методы `AddSSHIdentity`, `GetSSHIdentity` и структуры запросов `AddSSHIdentityRequest` и `GetSSHIdentityRequest` в cloudbroker/node |
#### security group
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-582 | Группа ручек `security_group` в cloudapi и в cloudbroker |
| BGOS-601 | Добавлены комментарии к структурам ответов |
#### storage policy
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-571 | Группа ручек `storage_policy` в cloudapi и в cloudbroker |
#### trunk
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-565 | Опциональное поле `Status` в структуру запроса `ListRequest` в cloudapi/trunk и в cloudbroker/trunk |
#### user
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-562 | Опциональное поле `AccountID` в структуру запроса `CreateVirtualRequest` в cloudapi/image и в cloudbroker/image |
#### vins
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-584 | Метод `Update` и структура запроса `UpdateRequest` в cloudbroker/vins |
| BGOS-584 | Поле `EnableSecGroups` в структуру ответа `ItemVINS` в cloudbroker/vins |
| BGOS-584 | Поле `EnableSecGroups` в структуру ответа `RecordVINS` в cloudapi/vins и в cloudbroker/vins |
#### SDN access groups
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-514 | Группа api access_groups |
| BGOS-598 | Поле `sep_name` в структуре ответа `AccessSEPPool` в cloudapi/stpolicy и в cloudbroker/stpolicy |
| BGOS-600 | Добавлены комментарии к структурам ответов |
### Исправлено
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-569 | Изменена структура ответа с `ListAudits` на `*ListAudits`, содержащую поля `Data` и `EntryCount` в методе `Audits` в cloudapi/compute |
| BGOS-569 | Изменена структура ответа с `ListDetailedAudits` на `*ListDetailedAudits`, содержащую поля `Data` и `EntryCount` в методе `Audits` в cloudbroker/compute |
#### user
#### account
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-561 | Изменен тип поля `UserIDs` с stirng на []string в структуре запроса `DeleteUsersRequest` в cloudbroker/user |
| BGOS-607 | Поле `StoragePolicies` в структуре запроса `CreateRequest` стало опциональным в cloudbroker/account |
| BGOS-607 | Изменен тип поля `ID` в структуре запроса `StoragePolicy` с int64 на uint64 в cloudbroker/account |
#### vins
#### rg
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-560 | Изменен тип возвращаемого значения методов `MassDelete`, `MassDisable`, `MassEnable` c bool на string в cloudbroker/vins|
| BGOS-607 | Изменен тип поля `ID` в структуре запроса `StoragePolicy` с int64 на uint64 в cloudapi/rg и в cloudbroker/rg |
| BGOS-607 | Поле `StoragePolicies` в структуре запроса `CreateRequest` стало опциональным в cloudbroker/account |
### Удалено
#### disks
#### account
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-563 | Опциональное поле `Drivers` в структуре запроса `FromPlatformDiskRequest` в cloudapi/disks и cloudbroker/disks |
| BGOS-605 | Поле `CKey` из структуры ответа `RecordAccount` в cloudapi/account и поля `CKey` из структуры ответа `InfoAccount` и `Meta` из структуры ответа `ItemAccount` в cloudbroker/account |
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-580 | Поле `ZoneID` в структуре ответа `ItemComputeDisk` в cloudapi/compute |
| BGOS-603 | Поля `VirtualImageID`, `VirtualImageName` из структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute и `RecordCompute` и `InfoCompute` в cloudbroker/compute |
| BGOS-603 | Поля `ImageID` из структуры ответа `ItemCompute` в cloudapi/compute и `InfoCompute` в cloudbroker/compute |
| BGOS-612 | Поле `ImageID` из структуры запроса `ListRequest` в cloudbroker/compute |
#### image
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-563 | Опциональное поле `Drivers` в структуре запроса `CreateRequest` в cloudapi/image и cloudbroker/image |
| BGOS-563 | Опциональное поле `Drivers` в структуре запроса `CreateCDROMImageRequest` в cloudbroker/image |
#### k8ci
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-563 | Опциональные поля `MasterDriver` и `WorkerDriver` в структурах запроса `ListRequest` и `ListDeletedRequest` в cloudapi/k8ci и cloudbroker/k8ci |
| BGOS-563 | Опциональные поля `MasterDriver` и `WorkerDriver` в структуре запроса `CreateRequest` в cloudbroker/k8ci |
#### kvmx86
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-563 | Опциональное поле `Driver` в структурах запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
| BGOS-604 | Метод `UpdateNodes` и структура запроса `UpdateNodesRequest` в cloudbroker/image |

@ -323,10 +323,10 @@ func main() {
- `pkg/cloudapi/locations` - для `Locations`
- `pkg/cloudapi/prometheus` - для `Prometheus`
- `pkg/cloudapi/rg` - для `RG`
- `pkg/cloudapi/security_group` - для `Security group`
- `pkg/cloudapi/secgroup` - для `Security group`
- `pkg/cloudapi/sep` - для `SEP`
- `pkg/cloudapi/stack` - для `Stack`
- `pkg/cloudapi/storage_policy` - для `Storage policy`
- `pkg/cloudapi/stpolicy` - для `Storage policy`
- `pkg/cloudapi/tasks` - для `Tasks`
- `pkg/cloudapi/trunk` - для `Trunk`
- `pkg/cloudapi/vfpool` - для `VFPool`
@ -355,10 +355,10 @@ func main() {
- `pkg/cloudbroker/prometheus` - для `Prometheus`
- `pkg/cloudbroker/resmon` - для `Resmon`
- `pkg/cloudbroker/rg` - для `RG`
- `pkg/cloudbroker/security_group` - для `Security group`
- `pkg/cloudbroker/secgroup` - для `Security group`
- `pkg/cloudbroker/sep` - для `SEP`
- `pkg/cloudbroker/stack` - для `Stack`
- `pkg/cloudbroker/storage_policy` - для `Storage policy`
- `pkg/cloudbroker/stpolicy` - для `Storage policy`
- `pkg/cloudbroker/tasks` - для `Tasks`
- `pkg/cloudbroker/trunk` - для `Trunk`
- `pkg/cloudbroker/user` - для `User`
@ -525,7 +525,7 @@ func main() {
- `.SecurityGroup()` - для работы с `Security Group`
- `.SEP()` - для работы с `SEP`
- `.Stack()` - для работы с `Stack`
- `.StoragePolicy()` - для работы с `Storage Policy`
- `.StPolicy()` - для работы с `Storage Policy`
- `.Tasks()` - для работы с `Tasks`
- `.Trunk()` - для работы с `Trunk`
- `.VFPool()` - для работы с `VFPool`
@ -559,7 +559,7 @@ func main() {
- `.SecurityGroup()` - для работы с `Security Group`
- `.SEP()` - для работы с `SEP`
- `.Stack()` - для работы с `Stack`
- `.StoragePolicy()` - для работы с `Storage Policy`
- `.StPolicy()` - для работы с `Storage Policy`
- `.Tasks()` - для работы с `Tasks`
- `.Trunk()` - для работы с `Trunk`
- `.User()` - для работы с `User`

@ -124,6 +124,18 @@ type ListAccounts struct {
EntryCount uint64 `json:"entryCount"`
}
// Policy
type Policy struct {
// Size of the disk
DiskSize float64 `json:"disksize"`
// Max size of the disk
DiskSizeMax float64 `json:"disksizemax"`
// SEPs used
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
// Resources used
type Resource struct {
// Number of cores
@ -144,6 +156,9 @@ type Resource struct {
// Number of grafic cores
GPU int64 `json:"gpu"`
// Policies
Policies map[string]Policy `json:"policies"`
// Number of RAM
RAM int64 `json:"ram"`
@ -218,9 +233,6 @@ type RecordAccount struct {
// DCLocation
DCLocation string `json:"DCLocation"`
// CKey
CKey string `json:"_ckey"`
// Access control list
ACL []RecordACL `json:"acl"`

@ -55,7 +55,6 @@ var computes = ListComputes{
GID: 212,
GUID: 48500,
ID: 48500,
ImageID: 9884,
Interfaces: []ItemVNFInterface{},
LockStatus: "UNLOCKED",
ManagerID: 0,
@ -82,7 +81,6 @@ var computes = ListComputes{
UserManaged: true,
VGPUs: []uint64{},
VINSConnected: 0,
VirtualImageID: 0,
ZoneID: 1,
},
{
@ -118,7 +116,6 @@ var computes = ListComputes{
GID: 212,
GUID: 48556,
ID: 48556,
ImageID: 9884,
Interfaces: []ItemVNFInterface{},
LockStatus: "UNLOCKED",
ManagerID: 0,
@ -145,7 +142,6 @@ var computes = ListComputes{
UserManaged: true,
VGPUs: []uint64{},
VINSConnected: 0,
VirtualImageID: 0,
ZoneID: 5,
},
},

@ -443,6 +443,9 @@ type RecordCompute struct {
// Natable VINS network name
NatableVINSNetworkName string `json:"natableVinsNetworkName"`
// Name of OS
OSVersion string `json:"os_version"`
// List OS Users
OSUsers ListOSUser `json:"osUsers"`
@ -509,12 +512,6 @@ type RecordCompute struct {
// vGPUs list
VGPUs []VGPUItem `json:"vgpus"`
// Virtual image ID
VirtualImageID uint64 `json:"virtualImageId"`
// Virtual image name
VirtualImageName string `json:"virtualImageName"`
// VNC password
VNCPassword string `json:"vncPasswd"`
@ -1066,9 +1063,6 @@ type ItemCompute struct {
// ID
ID uint64 `json:"id"`
// Image ID
ImageID uint64 `json:"imageId"`
// List interfaces
Interfaces ListInterfaces `json:"interfaces"`
@ -1117,6 +1111,9 @@ type ItemCompute struct {
// Number of RAM
RAM uint64 `json:"ram"`
// Name of OS
OSVersion string `json:"os_version"`
// Qemu_quest
QemuQuest QemuQuest `json:"qemu_guest"`
@ -1174,9 +1171,6 @@ type ItemCompute struct {
// VINS connected
VINSConnected uint64 `json:"vinsConnected"`
// Virtual image ID
VirtualImageID uint64 `json:"virtualImageId"`
// Zone ID
ZoneID uint64 `json:"zoneId"`
}

@ -21,6 +21,10 @@ type RedeployRequest struct {
// ID of the new OS image, if image change is required
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// new size for the boot disk in GB, if boot disk size change is required
// Required: false

@ -65,6 +65,10 @@ type UpdateRequest struct {
// Does this machine supports hot resize, true or false
// Required: false
HotResize interface{} `url:"hotResize,omitempty" json:"hotResize,omitempty" validate:"omitempty,isBool"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
}
// Update updates some properties of the compute

@ -46,6 +46,10 @@ type ListRequest struct {
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
// Find by storage policy id
// Required: false
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
// Find by pool name
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`

@ -38,6 +38,10 @@ type ListUnattachedRequest struct {
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
// Find by storage policy id
// Required: false
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
// Find by pool name
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`

@ -121,6 +121,10 @@ type CreateRequest struct {
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Size of the boot disk in GB
// Required: false
BootDisk uint64 `url:"bootDisk,omitempty" json:"bootDisk,omitempty"`

@ -92,6 +92,10 @@ type CreateBlankRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
}
// GetRAM returns RAM field values

@ -83,8 +83,8 @@ type CreateRequest struct {
}
type StoragePolicy struct {
ID int64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
ID uint64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
}
// Create creates resource group

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
// FilterByID returns ListSecurityGroups with specified ID.
func (lsg ListSecurityGroups) FilterByID(id uint64) ListSecurityGroups {

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import "testing"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -0,0 +1,94 @@
package secgroup
type ListSecurityGroups struct {
// List
Data []ItemSecurityGroup `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
type ItemSecurityGroup struct {
// ID of the security group
ID uint64 `json:"id"`
// Account ID that owns the security group
AccountID uint64 `json:"account_id"`
// Name of the security group
Name string `json:"name"`
// Description of the security group
Description string `json:"description"`
// List of rules
Rules Rules `json:"rules"`
// Created at
CreatedAt uint64 `json:"created_at"`
// Updated at
UpdatedAt uint64 `json:"updated_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated by
UpdatedBy string `json:"updated_by"`
}
type RecordSecurityGroup struct {
// ID of the security group
ID uint64 `json:"id"`
// Account ID that owns the security group
AccountID uint64 `json:"account_id"`
// Name of the security group
Name string `json:"name"`
// Description of the security group
Description string `json:"description"`
// List of rules
Rules Rules `json:"rules"`
// Created at
CreatedAt uint64 `json:"created_at"`
// Updated at
UpdatedAt uint64 `json:"updated_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated by
UpdatedBy string `json:"updated_by"`
}
type Rules []Rule
type Rule struct {
// ID of the rule
ID uint64 `json:"id"`
// Traffic direction (inbound/outbound)
Direction string `json:"direction"`
// IP protocol version
Ethertype string `json:"ethertype"`
// Network protocol
Protocol string `json:"protocol"`
// Start port number (for TCP/UDP)
PortRangeMin uint64 `json:"port_range_min"`
// End port number (for TCP/UDP)
PortRangeMax uint64 `json:"port_range_max"`
// Remote IP prefix in CIDR notation
RemoteIPPrefix string `json:"remote_ip_prefix"`
RemoteGroupID uint64 `json:"remote_group_id"`
}

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import "sort"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,43 +0,0 @@
package securitygroup
type ListSecurityGroups struct {
Data []ItemSecurityGroup `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
type ItemSecurityGroup struct {
ID uint64 `json:"id"`
AccountID uint64 `json:"account_id"`
Name string `json:"name"`
Description string `json:"description"`
Rules Rules `json:"rules"`
CreatedAt uint64 `json:"created_at"`
UpdatedAt uint64 `json:"updated_at"`
CreatedBy string `json:"created_by"`
UpdatedBy string `json:"updated_by"`
}
type RecordSecurityGroup struct {
ID uint64 `json:"id"`
AccountID uint64 `json:"account_id"`
Name string `json:"name"`
Description string `json:"description"`
Rules Rules `json:"rules"`
CreatedAt uint64 `json:"created_at"`
UpdatedAt uint64 `json:"updated_at"`
CreatedBy string `json:"created_by"`
UpdatedBy string `json:"updated_by"`
}
type Rules []Rule
type Rule struct {
ID uint64 `json:"id"`
Direction string `json:"direction"`
Ethertype string `json:"ethertype"`
Protocol string `json:"protocol"`
PortRangeMin uint64 `json:"port_range_min"`
PortRangeMax uint64 `json:"port_range_max"`
RemoteIPPrefix string `json:"remote_ip_prefix"`
RemoteGroupID uint64 `json:"remote_group_id"`
}

@ -1,10 +1,10 @@
package cloudapi
import (
securitygroup "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/security_group"
secgroup "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
)
// Accessing the Security Group method group
func (ca *CloudAPI) SecurityGroup() *securitygroup.SecurityGroup {
return securitygroup.New(ca.client)
func (ca *CloudAPI) SecurityGroup() *secgroup.SecurityGroup {
return secgroup.New(ca.client)
}

@ -0,0 +1,10 @@
package cloudapi
import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
)
// Accessing the Storage Policy method group
func (ca *CloudAPI) StPolicy() *stpolicy.StPolicy {
return stpolicy.New(ca.client)
}

@ -1,40 +0,0 @@
package storagepolicy
type ListStoragePolicies struct {
Data []ItemStoragePolicy `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
type ItemStoragePolicy struct {
ID uint64 `json:"id"`
GUID uint64 `json:"guid"`
Name string `json:"name"`
Description string `json:"description"`
AccessSepPools ListAccessSepPools `json:"access_seps_pools"`
Status string `json:"status"`
LimitIOPS uint64 `json:"limit_iops"`
Usage Usage `json:"usage"`
}
type InfoStoragePolicy struct {
ID uint64 `json:"id"`
GUID uint64 `json:"guid"`
Name string `json:"name"`
Description string `json:"description"`
AccessSepPools ListAccessSepPools `json:"access_seps_pools"`
Status string `json:"status"`
LimitIOPS uint64 `json:"limit_iops"`
Usage Usage `json:"usage"`
}
type ListAccessSepPools []AccessSepPool
type AccessSepPool struct {
SepID uint64 `json:"sep_id"`
PoolNames []string `json:"pool_names"`
}
type Usage struct {
Accounts []uint64 `json:"accounts"`
Resgroups []uint64 `json:"resgroups"`
}

@ -1,10 +0,0 @@
package cloudapi
import (
storagepolicy "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/storage_policy"
)
// Accessing the Storage Policy method group
func (ca *CloudAPI) StoragePolicy() *storagepolicy.StoragePolicy {
return storagepolicy.New(ca.client)
}

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -14,7 +14,7 @@ type GetRequest struct {
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
}
func (sp StoragePolicy) Get(ctx context.Context, req GetRequest) (*InfoStoragePolicy, error) {
func (sp StPolicy) Get(ctx context.Context, req GetRequest) (*InfoStoragePolicy, error) {
res, err := sp.GetRaw(ctx, req)
if err != nil {
return nil, err
@ -30,7 +30,7 @@ func (sp StoragePolicy) Get(ctx context.Context, req GetRequest) (*InfoStoragePo
return &info, nil
}
func (sp StoragePolicy) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
func (sp StPolicy) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -59,7 +59,7 @@ type ListRequest struct {
}
// List gets list of storage policies as a ListStoragePolicies struct
func (sp StoragePolicy) List(ctx context.Context, req ListRequest) (*ListStoragePolicies, error) {
func (sp StPolicy) List(ctx context.Context, req ListRequest) (*ListStoragePolicies, error) {
res, err := sp.ListRaw(ctx, req)
if err != nil {
@ -77,7 +77,7 @@ func (sp StoragePolicy) List(ctx context.Context, req ListRequest) (*ListStorage
}
// ListRaw gets list of storage policies as an array of bytes
func (sp StoragePolicy) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
func (sp StPolicy) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -0,0 +1,82 @@
package stpolicy
type ListStoragePolicies struct {
// List
Data []ItemStoragePolicy `json:"data"`
// Entry Count
EntryCount uint64 `json:"entryCount"`
}
type ItemStoragePolicy struct {
// ID of the storage policy
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the storage policy
Name string `json:"name"`
// Description of the storage policy
Description string `json:"description"`
// List of pools in SEP for storage policy
AccessSEPPools ListAccessSEPPools `json:"access_seps_pools"`
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the sotrage policy
LimitIOPS uint64 `json:"limit_iops"`
// Which accounts and resource groups use the storage policy
Usage Usage `json:"usage"`
}
type InfoStoragePolicy struct {
// ID of the storage policy
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the storage policy
Name string `json:"name"`
// Description of the storage policy
Description string `json:"description"`
// List of pools in SEP for storage policy
AccessSEPPools ListAccessSEPPools `json:"access_seps_pools"`
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the sotrage policy
LimitIOPS uint64 `json:"limit_iops"`
// Which accounts and resource groups use the storage policy
Usage Usage `json:"usage"`
}
type ListAccessSEPPools []AccessSEPPool
type AccessSEPPool struct {
// SEP ID
SEPID uint64 `json:"sep_id"`
// SEP name
Name string `json:"sep_name"`
// Pool names
PoolNames []string `json:"pool_names"`
}
type Usage struct {
// List of accounts
Accounts []uint64 `json:"accounts"`
// List of resource groups
Resgroups []uint64 `json:"resgroups"`
}

@ -1,15 +1,15 @@
package storagepolicy
package stpolicy
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
// Structure for creating request to storage policy
type StoragePolicy struct {
type StPolicy struct {
client interfaces.Caller
}
// Builder for stack endpoint
func New(client interfaces.Caller) *StoragePolicy {
return &StoragePolicy{
func New(client interfaces.Caller) *StPolicy {
return &StPolicy{
client: client,
}
}

@ -29,7 +29,7 @@ type CreateRequest struct {
// Storage policies
// Required: false
StoragePolicies []StoragePolicy `url:"-" json:"storage_policies" validate:"required"`
StoragePolicies []StoragePolicy `url:"-" json:"storage_policies,omitempty"`
// Max size of memory in MB
// Required: false
@ -79,8 +79,8 @@ type CreateRequest struct {
}
type StoragePolicy struct {
ID int64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
ID uint64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
}
// Create creates account

@ -7,7 +7,6 @@ import (
var accounts = ListAccounts{
Data: []ItemAccount{
{
Meta: []interface{}{},
InfoAccount: InfoAccount{
CreatedTime: 1676878820,
DeletedTime: 0,
@ -28,7 +27,6 @@ var accounts = ListAccounts{
},
},
{
Meta: []interface{}{},
InfoAccount: InfoAccount{
CreatedTime: 1676645275,
DeletedTime: 1677723401,
@ -49,7 +47,6 @@ var accounts = ListAccounts{
},
},
{
Meta: []interface{}{},
InfoAccount: InfoAccount{
CreatedTime: 1676883850,
DeletedTime: 1676883899,

@ -46,6 +46,18 @@ type ListResources struct {
EntryCount uint64 `json:"entryCount"`
}
// Policy
type Policy struct {
// Size of the disk
DiskSize float64 `json:"disksize"`
// Max size of the disk
DiskSizeMax float64 `json:"disksizemax"`
// SEPs used
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
type Resource struct {
// Number of cores
CPU int64 `json:"cpu"`
@ -70,6 +82,9 @@ type Resource struct {
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
// Policies
Policies map[string]Policy `json:"policies"`
}
// Disk usage
@ -143,9 +158,6 @@ type InfoAccount struct {
// DCLocation
DCLocation string `json:"DCLocation"`
// CKey
CKey string `json:"_ckey"`
// Company
Company string `json:"company"`
@ -245,8 +257,6 @@ type RecordAccount struct {
// More information about account
type ItemAccount struct {
// Meta
Meta []interface{} `json:"_meta"`
// Access Control List
ACL []ACL `json:"acl"`

@ -58,7 +58,6 @@ var computes = ListComputes{
GID: 212,
GUID: 48500,
ID: 48500,
ImageID: 9884,
Interfaces: ListInterfaces{},
LockStatus: "UNLOCKED",
ManagerID: 0,
@ -85,7 +84,6 @@ var computes = ListComputes{
UserManaged: true,
VGPUs: []uint64{},
VINSConnected: 0,
VirtualImageID: 0,
},
},
{
@ -122,7 +120,6 @@ var computes = ListComputes{
GID: 212,
GUID: 48556,
ID: 48556,
ImageID: 9884,
Interfaces: ListInterfaces{},
LockStatus: "UNLOCKED",
ManagerID: 0,
@ -149,7 +146,6 @@ var computes = ListComputes{
UserManaged: true,
VGPUs: []uint64{},
VINSConnected: 0,
VirtualImageID: 0,
},
},
},
@ -301,7 +297,6 @@ var deleteComputes = ListDeletedComputes{
GID: 212,
GUID: 48500,
ID: 48500,
ImageID: 9884,
Interfaces: ListInterfaces{},
LockStatus: "UNLOCKED",
ManagerID: 0,
@ -327,7 +322,6 @@ var deleteComputes = ListDeletedComputes{
UserManaged: true,
VGPUs: []uint64{},
VINSConnected: 0,
VirtualImageID: 0,
},
},
{
@ -364,7 +358,6 @@ var deleteComputes = ListDeletedComputes{
GID: 212,
GUID: 48556,
ID: 48556,
ImageID: 9884,
Interfaces: ListInterfaces{},
LockStatus: "UNLOCKED",
ManagerID: 0,
@ -390,7 +383,6 @@ var deleteComputes = ListDeletedComputes{
UserManaged: true,
VGPUs: []uint64{},
VINSConnected: 0,
VirtualImageID: 0,
},
},
},

@ -46,10 +46,6 @@ type ListRequest struct {
// Required: false
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
// Find by image ID
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// Find by CD image ID
// Required: false
CDImageID uint64 `url:"cdImageId,omitempty" json:"cdImageId,omitempty"`

@ -0,0 +1,55 @@
package compute
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// MigrateStorageListRequest struct to get list of jobs
type MigrateStorageListRequest struct {
// Find by job ID
// Required: false
MigrationJobID uint64 `url:"migration_job_id,omitempty" json:"migration_job_id,omitempty"`
// If True then return completed jobs
// Required: false
Completed interface{} `url:"completed,omitempty" json:"completed,omitempty" validate:"omitempty,isBool"`
// 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"`
}
// MigrateStorageList gets list of the jobs.
func (c Compute) MigrateStorageList(ctx context.Context, req MigrateStorageListRequest) (*ListMigrateStorage, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/migrate_storage_list"
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
if err != nil {
return nil, err
}
list := ListMigrateStorage{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}

@ -720,9 +720,6 @@ type InfoCompute struct {
// ID
ID uint64 `json:"id"`
// Image ID
ImageID uint64 `json:"imageId"`
// List interfaces
Interfaces ListInterfaces `json:"interfaces"`
@ -765,6 +762,9 @@ type InfoCompute struct {
// List OS users
OSUsers ListOSUsers `json:"osUsers"`
// Name of OS
OSVersion string `json:"os_version"`
// Pinned to stack
PinnedToStack int64 `json:"pinnedToStack"`
@ -840,9 +840,6 @@ type InfoCompute struct {
// VINS connected
VINSConnected uint64 `json:"vinsConnected"`
// Virtual image ID
VirtualImageID uint64 `json:"virtualImageId"`
// Zone ID
ZoneID uint64 `json:"zoneId"`
}
@ -1046,6 +1043,9 @@ type RecordCompute struct {
// List OS users
OSUsers ListOSUsers `json:"osUsers"`
// Name of OS
OSVersion string `json:"os_version"`
// Pinned to stack
PinnedToStack int64 `json:"pinnedToStack"`
@ -1118,12 +1118,6 @@ type RecordCompute struct {
// List VGPU
VGPUs []VGPUItem `json:"vgpus"`
// Virtual image ID
VirtualImageID uint64 `json:"virtualImageId"`
// VirtualImageName
VirtualImageName string `json:"virtualImageName"`
// VNC password
VNCPassword string `json:"vncPasswd"`
@ -1375,3 +1369,31 @@ type ItemVGPU struct {
// VM ID
VMID uint64 `json:"vmid"`
}
type ListMigrateStorage struct {
EntryCount uint64 `json:"entryCount"`
Data []MigrateStorageItem `json:"data"`
}
type MigrateStorageItem struct {
// Migration completion status
Completed bool `json:"completed"`
// Domain name
DomainName string `json:"domainName"`
// Migration job ID
ID uint64 `json:"id"`
// Migration process log
Log []string `json:"log"`
// Source stack ID
SourceStackID uint64 `json:"sourceStackId"`
// Migration status
Status string `json:"status"`
// Target stack ID
TargetStackID uint64 `json:"targetStackId"`
}

@ -18,6 +18,10 @@ type RedeployRequest struct {
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Storage policy id of compute. The rules of the specified storage policy will be used.
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`

@ -0,0 +1,36 @@
package compute
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// StartMigrationINRequest struct to start compute for external migration in
type StartMigrationINRequest struct {
// ID of compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// ID of the stack where the compute will be staged for migration-in
// Required: false
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
}
// StartMigrationIN starts compute for external migration in
func (c Compute) StartMigrationIN(ctx context.Context, req StartRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/start_migration_in"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
return string(res), nil
}

@ -0,0 +1,36 @@
package compute
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// StopMigrationINRequest struct to stop compute for external migration in
type StopMigrationINRequest struct {
// ID of compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// If provided, indicates the UUID of the VM on the target host and that migration completed.
// Required: false
NewVMUUID string `url:"new_vm_uuid,omitempty" json:"new_vm_uuid,omitempty"`
}
// StopMigrationIN stops compute for external migration in
func (c Compute) StopMigrationIN(ctx context.Context, req StartRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/stop_migration_in"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
return string(res), nil
}

@ -65,6 +65,10 @@ type UpdateRequest struct {
// Does this machine supports hot resize, true or false
// Required: false
HotResize interface{} `url:"hotResize,omitempty" json:"hotResize,omitempty" validate:"omitempty,isBool"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
}
// Update updates some properties of the compute

@ -46,6 +46,10 @@ type ListRequest struct {
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
// Find by storage policy id
// Required: false
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
// Find by pool name
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`

@ -38,6 +38,10 @@ type ListUnattachedRequest struct {
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
// Find by storage policy id
// Required: false
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
// Find by pool name
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`

@ -1,42 +0,0 @@
package image
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// UpdateNodesRequest struct to update nodes
type UpdateNodesRequest struct {
// Image ID
// Required: true
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
// List of stacks
// Required: false
EnabledStacks []uint64 `url:"enabledStacks,omitempty" json:"enabledStacks,omitempty"`
}
// UpdateNodes updates image availability on nodes
func (i Image) UpdateNodes(ctx context.Context, req UpdateNodesRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/image/updateNodes"
res, err := i.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
}

@ -121,6 +121,10 @@ type CreateRequest struct {
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Size of the boot disk in GB
// Required: false
BootDisk uint64 `url:"bootDisk,omitempty" json:"bootDisk,omitempty"`

@ -92,6 +92,10 @@ type CreateBlankRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
}
// GetRAM returns RAM field values

@ -87,6 +87,10 @@ type MassCreateRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
}
type asyncWrapperMassCreateRequest struct {

@ -0,0 +1,54 @@
package node
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// AddSSHIdentityRequest struct to add node ssh information
type AddSSHIdentityRequest struct {
// Node ID
// Required: true
NID uint64 `url:"node_id" json:"node_id" validate:"required"`
// Host name of the client
// Required: true
ClientHostName string `url:"client_host_name" json:"client_host_name" validate:"required"`
// SSH host key of the client
// Required: true
ClientHostKey string `url:"client_host_key" json:"client_host_key" validate:"required" `
// SSH public key of the client
// Required: true
ClientPublicKey string `url:"client_public_key" json:"client_public_key" validate:"required"`
// IPv4 address
// Required: true
ClientIPAddress string `url:"client_ip_address" json:"client_ip_address" validate:"required" `
}
// AddSSHIdentity adds node ssh information
func (n Node) AddSSHIdentity(ctx context.Context, req AddSSHIdentityRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/node/add_ssh_identity"
res, err := n.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
}

@ -0,0 +1,39 @@
package node
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// GetSSHIdentityRequest struct to get node ssh information
type GetSSHIdentityRequest struct {
// Node ID
// Required: true
NID uint64 `url:"node_id" json:"node_id" validate:"required"`
}
// GetSSHIdentity gets node ssh information
func (n Node) GetSSHIdentity(ctx context.Context, req GetSSHIdentityRequest) (*SSHIdentity, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/node/get_ssh_identity"
res, err := n.client.DecortApiCall(ctx, http.MethodGet, url, req)
if err != nil {
return nil, err
}
info := SSHIdentity{}
err = json.Unmarshal(res, &info)
if err != nil {
return nil, err
}
return &info, nil
}

@ -392,3 +392,15 @@ type Role struct {
Reason string `json:"reason"`
Time uint64 `json:"time"`
}
// Information about SSH Identity
type SSHIdentity struct {
//Host name of the client
HostName string `json:"host_name"`
//SSH host key of the client
HostKey string `json:"host_key"`
//Array of SSH public keys of the client
PublicKeys []string `json:"public_keys"`
}

@ -88,8 +88,8 @@ type CreateRequest struct {
}
type StoragePolicy struct {
ID int64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
ID uint64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
}
// Create creates resource group

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
// FilterByID returns ListSecurityGroups with specified ID.
func (lsg ListSecurityGroups) FilterByID(id uint64) ListSecurityGroups {

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import "testing"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -0,0 +1,94 @@
package secgroup
type ListSecurityGroups struct {
// List
Data []ItemSecurityGroup `json:"data"`
// Entry count
EntryCount uint64 `json:"entryCount"`
}
type ItemSecurityGroup struct {
// ID of the security group
ID uint64 `json:"id"`
// Account ID that owns the security group
AccountID uint64 `json:"account_id"`
// Name of the security group
Name string `json:"name"`
// Description of the security group
Description string `json:"description"`
// List of rules
Rules Rules `json:"rules"`
// Created at
CreatedAt uint64 `json:"created_at"`
// Updated at
UpdatedAt uint64 `json:"updated_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated by
UpdatedBy string `json:"updated_by"`
}
type RecordSecurityGroup struct {
// ID of the security group
ID uint64 `json:"id"`
// Account ID that owns the security group
AccountID uint64 `json:"account_id"`
// Name of the security group
Name string `json:"name"`
// Description of the security group
Description string `json:"description"`
// List of rules
Rules Rules `json:"rules"`
// Created at
CreatedAt uint64 `json:"created_at"`
// Updated at
UpdatedAt uint64 `json:"updated_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated by
UpdatedBy string `json:"updated_by"`
}
type Rules []Rule
type Rule struct {
// ID of the rule
ID uint64 `json:"id"`
// Traffic direction (inbound/outbound)
Direction string `json:"direction"`
// IP protocol version
Ethertype string `json:"ethertype"`
// Network protocol
Protocol string `json:"protocol"`
// Start port number (for TCP/UDP)
PortRangeMin uint64 `json:"port_range_min"`
// End port number (for TCP/UDP)
PortRangeMax uint64 `json:"port_range_max"`
// Remote IP prefix in CIDR notation
RemoteIPPrefix string `json:"remote_ip_prefix"`
RemoteGroupID uint64 `json:"remote_group_id"`
}

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import "sort"

@ -1,4 +1,4 @@
package securitygroup
package secgroup
import (
"context"

@ -1,43 +0,0 @@
package securitygroup
type ListSecurityGroups struct {
Data []ItemSecurityGroup `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
type ItemSecurityGroup struct {
ID uint64 `json:"id"`
AccountID uint64 `json:"account_id"`
Name string `json:"name"`
Description string `json:"description"`
Rules Rules `json:"rules"`
CreatedAt uint64 `json:"created_at"`
UpdatedAt uint64 `json:"updated_at"`
CreatedBy string `json:"created_by"`
UpdatedBy string `json:"updated_by"`
}
type RecordSecurityGroup struct {
ID uint64 `json:"id"`
AccountID uint64 `json:"account_id"`
Name string `json:"name"`
Description string `json:"description"`
Rules Rules `json:"rules"`
CreatedAt uint64 `json:"created_at"`
UpdatedAt uint64 `json:"updated_at"`
CreatedBy string `json:"created_by"`
UpdatedBy string `json:"updated_by"`
}
type Rules []Rule
type Rule struct {
ID uint64 `json:"id"`
Direction string `json:"direction"`
Ethertype string `json:"ethertype"`
Protocol string `json:"protocol"`
PortRangeMin uint64 `json:"port_range_min"`
PortRangeMax uint64 `json:"port_range_max"`
RemoteIPPrefix string `json:"remote_ip_prefix"`
RemoteGroupID uint64 `json:"remote_group_id"`
}

@ -1,10 +1,10 @@
package cloudbroker
import (
securitygroup "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/security_group"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
)
// Accessing the Security Group method group
func (cb *CloudBroker) SecurityGroup() *securitygroup.SecurityGroup {
return securitygroup.New(cb.client)
func (cb *CloudBroker) SecurityGroup() *secgroup.SecurityGroup {
return secgroup.New(cb.client)
}

@ -0,0 +1,10 @@
package cloudbroker
import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
)
// Accessing the Storage Policy method group
func (cb *CloudBroker) StPolicy() *stpolicy.StPolicy {
return stpolicy.New(cb.client)
}

@ -1,51 +0,0 @@
package storagepolicy
type InfoStoragePolicyWithID struct {
ID uint64 `json:"id"`
GUID uint64 `json:"guid"`
Name string `json:"name"`
Description string `json:"description"`
AccessSepPools ListAccessSepPools `json:"access_seps_pools"`
Status string `json:"status"`
LimitIOPS uint64 `json:"limit_iops"`
StoragePolicyID uint64 `json:"storage_policy_id"`
}
type ListStoragePolicies struct {
Data []ItemStoragePolicy `json:"data"`
EntryCount uint64 `json:"entryCount"`
}
type ItemStoragePolicy struct {
ID uint64 `json:"id"`
GUID uint64 `json:"guid"`
Name string `json:"name"`
Description string `json:"description"`
AccessSepPools ListAccessSepPools `json:"access_seps_pools"`
Status string `json:"status"`
LimitIOPS uint64 `json:"limit_iops"`
Usage Usage `json:"usage"`
}
type InfoStoragePolicy struct {
ID uint64 `json:"id"`
GUID uint64 `json:"guid"`
Name string `json:"name"`
Description string `json:"description"`
AccessSepPools ListAccessSepPools `json:"access_seps_pools"`
Status string `json:"status"`
LimitIOPS uint64 `json:"limit_iops"`
Usage Usage `json:"usage"`
}
type ListAccessSepPools []AccessSepPool
type AccessSepPool struct {
SepID uint64 `json:"sep_id"`
PoolNames []string `json:"pool_names"`
}
type Usage struct {
Accounts []uint64 `json:"accounts"`
Resgroups []uint64 `json:"resgroups"`
}

@ -1,10 +0,0 @@
package cloudbroker
import (
storagepolicy "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/storage_policy"
)
// Accessing the Storage Policy method group
func (cb *CloudBroker) StoragePolicy() *storagepolicy.StoragePolicy {
return storagepolicy.New(cb.client)
}

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -15,14 +15,14 @@ type AddPoolRequest struct {
// Storage endpoint provider ID to add
// Required: true
SepID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Pool to add
// Required: true
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
}
func (sp StoragePolicy) AddPool(ctx context.Context, req AddPoolRequest) (*InfoStoragePolicyWithID, error) {
func (sp StPolicy) AddPool(ctx context.Context, req AddPoolRequest) (*InfoStoragePolicyWithID, error) {
res, err := sp.AddPoolRaw(ctx, req)
if err != nil {
return nil, err
@ -38,7 +38,7 @@ func (sp StoragePolicy) AddPool(ctx context.Context, req AddPoolRequest) (*InfoS
return &info, nil
}
func (sp StoragePolicy) AddPoolRaw(ctx context.Context, req AddPoolRequest) ([]byte, error) {
func (sp StPolicy) AddPoolRaw(ctx context.Context, req AddPoolRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -9,11 +9,11 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
type AccessSepsPool struct {
type AccessSEPsPool struct {
// Storage endpoint provider ID
// Required: true
SepID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Names of pools
// Required: true
@ -27,7 +27,7 @@ type CreateRequest struct {
// List of storage endpoint access objects
// Required: true
AccessSepsPools []AccessSepPool `url:"access_seps_pools" json:"access_seps_pools" validate:"required"`
AccessSEPsPools []AccessSEPsPool `url:"access_seps_pools" json:"access_seps_pools" validate:"required"`
// Description of the storage policy
// Required: false
@ -40,7 +40,7 @@ type CreateRequest struct {
}
// Create creates a new storage policy
func (sp StoragePolicy) Create(ctx context.Context, req CreateRequest) (uint64, error) {
func (sp StPolicy) Create(ctx context.Context, req CreateRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -14,7 +14,7 @@ type DeleteRequest struct {
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
}
func (sp StoragePolicy) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
func (sp StPolicy) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -8,21 +8,21 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
type DeletePollRequest struct {
type DeletePoolRequest struct {
// ID of storage policy
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Storage endpoint provider ID to delete
// Required: true
SepID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Pool to delete
// Required: true
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
}
func (sp StoragePolicy) DeletePool(ctx context.Context, req DeletePollRequest) (*InfoStoragePolicyWithID, error) {
func (sp StPolicy) DeletePool(ctx context.Context, req DeletePoolRequest) (*InfoStoragePolicyWithID, error) {
res, err := sp.DeletePoolRaw(ctx, req)
if err != nil {
return nil, err
@ -38,7 +38,7 @@ func (sp StoragePolicy) DeletePool(ctx context.Context, req DeletePollRequest) (
return &info, nil
}
func (sp StoragePolicy) DeletePoolRaw(ctx context.Context, req DeletePollRequest) ([]byte, error) {
func (sp StPolicy) DeletePoolRaw(ctx context.Context, req DeletePoolRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -14,7 +14,7 @@ type DisableRequest struct {
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
}
func (sp StoragePolicy) Disable(ctx context.Context, req DisableRequest) (bool, error) {
func (sp StPolicy) Disable(ctx context.Context, req DisableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -14,7 +14,7 @@ type EnableRequest struct {
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
}
func (sp StoragePolicy) Enable(ctx context.Context, req EnableRequest) (bool, error) {
func (sp StPolicy) Enable(ctx context.Context, req EnableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
// FilterByID returns ListStoragePolicies with specified ID.
func (lsp ListStoragePolicies) FilterByID(id uint64) ListStoragePolicies {

@ -1,19 +1,19 @@
package storagepolicy
package stpolicy
import "testing"
var asp9 = AccessSepPool{
SepID: 9,
var asp9 = AccessSEPPool{
SEPID: 9,
PoolNames: []string{"data03"},
}
var asp7 = AccessSepPool{
SepID: 7,
var asp7 = AccessSEPPool{
SEPID: 7,
PoolNames: []string{"pool_QA"},
}
var asp8 = AccessSepPool{
SepID: 8,
var asp8 = AccessSEPPool{
SEPID: 8,
PoolNames: []string{
"alpha_pool_block",
"alpha_pool_stripe",
@ -28,7 +28,7 @@ var storagePolicyItems = ListStoragePolicies{
GUID: 1,
Name: "storagePolicy01",
Description: "desc",
AccessSepPools: ListAccessSepPools{asp7},
AccessSEPPools: ListAccessSEPPools{asp7},
Status: "ENABLED",
LimitIOPS: 2000,
Usage: Usage{},
@ -38,7 +38,7 @@ var storagePolicyItems = ListStoragePolicies{
GUID: 3,
Name: "storagePolicy03",
Description: "desc",
AccessSepPools: ListAccessSepPools{asp7, asp8, asp9},
AccessSEPPools: ListAccessSEPPools{asp7, asp8, asp9},
Status: "ENABLED",
LimitIOPS: 2500,
Usage: Usage{},
@ -48,7 +48,7 @@ var storagePolicyItems = ListStoragePolicies{
GUID: 5,
Name: "storagePolicy05",
Description: "another desc",
AccessSepPools: ListAccessSepPools{asp8, asp9},
AccessSEPPools: ListAccessSEPPools{asp8, asp9},
Status: "DISABLED",
LimitIOPS: 2000,
Usage: Usage{},

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -14,7 +14,7 @@ type GetRequest struct {
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
}
func (sp StoragePolicy) Get(ctx context.Context, req GetRequest) (*InfoStoragePolicy, error) {
func (sp StPolicy) Get(ctx context.Context, req GetRequest) (*InfoStoragePolicy, error) {
res, err := sp.GetRaw(ctx, req)
if err != nil {
return nil, err
@ -30,7 +30,7 @@ func (sp StoragePolicy) Get(ctx context.Context, req GetRequest) (*InfoStoragePo
return &info, nil
}
func (sp StoragePolicy) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
func (sp StPolicy) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -59,7 +59,7 @@ type ListRequest struct {
}
// List gets list of storage policies as a ListStoragePolicies struct
func (sp StoragePolicy) List(ctx context.Context, req ListRequest) (*ListStoragePolicies, error) {
func (sp StPolicy) List(ctx context.Context, req ListRequest) (*ListStoragePolicies, error) {
res, err := sp.ListRaw(ctx, req)
if err != nil {
@ -77,7 +77,7 @@ func (sp StoragePolicy) List(ctx context.Context, req ListRequest) (*ListStorage
}
// ListRaw gets list of storage policies as an array of bytes
func (sp StoragePolicy) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
func (sp StPolicy) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -0,0 +1,108 @@
package stpolicy
type InfoStoragePolicyWithID struct {
// ID of the storage policy
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the storage policy
Name string `json:"name"`
// Description of the storage policy
Description string `json:"description"`
// List of pools in SEP for storage policy
AccessSEPPools ListAccessSEPPools `json:"access_seps_pools"`
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the sotrage policy
LimitIOPS uint64 `json:"limit_iops"`
// ID of the storage policy
StoragePolicyID uint64 `json:"storage_policy_id"`
}
type ListStoragePolicies struct {
// List
Data []ItemStoragePolicy `json:"data"`
// Entry Count
EntryCount uint64 `json:"entryCount"`
}
type ItemStoragePolicy struct {
// ID of the storage policy
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the storage policy
Name string `json:"name"`
// Description of the storage policy
Description string `json:"description"`
// List of pools in SEP for storage policy
AccessSEPPools ListAccessSEPPools `json:"access_seps_pools"`
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the sotrage policy
LimitIOPS uint64 `json:"limit_iops"`
// Which accounts and resource groups use the storage policy
Usage Usage `json:"usage"`
}
type InfoStoragePolicy struct {
// ID of the storage policy
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the storage policy
Name string `json:"name"`
// Description of the storage policy
Description string `json:"description"`
// List of pools in SEP for storage policy
AccessSEPPools ListAccessSEPPools `json:"access_seps_pools"`
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the storage policy
LimitIOPS uint64 `json:"limit_iops"`
// Which accounts and resource groups use the storage policy
Usage Usage `json:"usage"`
}
type ListAccessSEPPools []AccessSEPPool
type AccessSEPPool struct {
// SEP ID
SEPID uint64 `json:"sep_id"`
// SEP name
Name string `json:"sep_name"`
// Pool names
PoolNames []string `json:"pool_names"`
}
type Usage struct {
// List of accounts
Accounts []uint64 `json:"accounts"`
// List of resource groups
Resgroups []uint64 `json:"resgroups"`
}

@ -1,15 +1,15 @@
package storagepolicy
package stpolicy
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
// Structure for creating request to storage policy
type StoragePolicy struct {
type StPolicy struct {
client interfaces.Caller
}
// Builder for stack endpoint
func New(client interfaces.Caller) *StoragePolicy {
return &StoragePolicy{
func New(client interfaces.Caller) *StPolicy {
return &StPolicy{
client: client,
}
}

@ -1,4 +1,4 @@
package storagepolicy
package stpolicy
import (
"context"
@ -27,7 +27,7 @@ type UpdateRequest struct {
}
// Update updates storage policy
func (sp StoragePolicy) Update(ctx context.Context, req UpdateRequest) (*InfoStoragePolicyWithID, error) {
func (sp StPolicy) Update(ctx context.Context, req UpdateRequest) (*InfoStoragePolicyWithID, error) {
res, err := sp.UpdateRaw(ctx, req)
if err != nil {
return nil, err
@ -43,7 +43,7 @@ func (sp StoragePolicy) Update(ctx context.Context, req UpdateRequest) (*InfoSto
return &info, nil
}
func (sp StoragePolicy) UpdateRaw(ctx context.Context, req UpdateRequest) ([]byte, error) {
func (sp StPolicy) UpdateRaw(ctx context.Context, req UpdateRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))

@ -17,10 +17,10 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/lb"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/locations"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/rg"
securitygroup "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/security_group"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/sep"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
storagepolicy "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/storage_policy"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vins"
@ -42,10 +42,10 @@ import (
node_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/node"
pcidevice_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/pcidevice"
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
securitygroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/security_group"
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
stack_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stack"
storagepolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/storage_policy"
stpolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
vins_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vins"
@ -308,40 +308,40 @@ func TestGetListCloudAPI(t *testing.T) {
// Storage policy
// List
bytes, err = client.CloudAPI().StoragePolicy().ListRaw(context.Background(), storagepolicy.ListRequest{})
bytes, err = client.CloudAPI().StPolicy().ListRaw(context.Background(), stpolicy.ListRequest{})
if err != nil {
t.Error(err)
}
getResult("Storage policy list", bytes, storagepolicy.ListStoragePolicies{}, t)
getResult("Storage policy list", bytes, stpolicy.ListStoragePolicies{}, t)
// Get
listStoragePolicies, _ := client.CloudAPI().StoragePolicy().List(context.Background(), storagepolicy.ListRequest{})
listStoragePolicies, _ := client.CloudAPI().StPolicy().List(context.Background(), stpolicy.ListRequest{})
if len(listStoragePolicies.Data) > 0 {
id := listStoragePolicies.Data[0].ID
bytes, err = client.CloudAPI().StoragePolicy().GetRaw(context.Background(), storagepolicy.GetRequest{StoragePolicyID: id})
bytes, err = client.CloudAPI().StPolicy().GetRaw(context.Background(), stpolicy.GetRequest{StoragePolicyID: id})
if err != nil {
t.Error(err)
}
getResult("Storage policy get", bytes, storagepolicy.InfoStoragePolicy{}, t)
getResult("Storage policy get", bytes, stpolicy.InfoStoragePolicy{}, t)
} else {
t.Errorf("Can not test Storage policy get because Storage policy list is empty")
}
// Security group
// List
bytes, err = client.CloudAPI().SecurityGroup().ListRaw(context.Background(), securitygroup.ListRequest{})
bytes, err = client.CloudAPI().SecurityGroup().ListRaw(context.Background(), secgroup.ListRequest{})
if err != nil {
t.Error(err)
}
getResult("Security group list", bytes, securitygroup.ListSecurityGroups{}, t)
getResult("Security group list", bytes, secgroup.ListSecurityGroups{}, t)
// Get
listSecurityGroups, _ := client.CloudAPI().SecurityGroup().List(context.Background(), securitygroup.ListRequest{})
listSecurityGroups, _ := client.CloudAPI().SecurityGroup().List(context.Background(), secgroup.ListRequest{})
if len(listSecurityGroups.Data) > 0 {
id := listSecurityGroups.Data[0].ID
bytes, err = client.CloudAPI().SecurityGroup().GetRaw(context.Background(), securitygroup.GetRequest{SecurityGroupID: id})
bytes, err = client.CloudAPI().SecurityGroup().GetRaw(context.Background(), secgroup.GetRequest{SecurityGroupID: id})
if err != nil {
t.Error(err)
}
getResult("Security group get", bytes, securitygroup.RecordSecurityGroup{}, t)
getResult("Security group get", bytes, secgroup.RecordSecurityGroup{}, t)
} else {
t.Errorf("Can not test Security group get because Security group list is empty")
}
@ -728,20 +728,20 @@ func TestGetListCloudbroker(t *testing.T) {
// Security group
// List
bytes, err = client.CloudBroker().SecurityGroup().ListRaw(context.Background(), securitygroup_cb.ListRequest{})
bytes, err = client.CloudBroker().SecurityGroup().ListRaw(context.Background(), secgroup_cb.ListRequest{})
if err != nil {
t.Error(err)
}
getResult("Security group list", bytes, securitygroup_cb.ListSecurityGroups{}, t)
getResult("Security group list", bytes, secgroup_cb.ListSecurityGroups{}, t)
// Get
listSecurityGroups, _ := client.CloudBroker().SecurityGroup().List(context.Background(), securitygroup_cb.ListRequest{})
listSecurityGroups, _ := client.CloudBroker().SecurityGroup().List(context.Background(), secgroup_cb.ListRequest{})
if len(listSecurityGroups.Data) > 0 {
id := listSecurityGroups.Data[0].ID
bytes, err = client.CloudBroker().SecurityGroup().GetRaw(context.Background(), securitygroup_cb.GetRequest{SecurityGroupID: id})
bytes, err = client.CloudBroker().SecurityGroup().GetRaw(context.Background(), secgroup_cb.GetRequest{SecurityGroupID: id})
if err != nil {
t.Error(err)
}
getResult("Security group get", bytes, securitygroup_cb.RecordSecurityGroup{}, t)
getResult("Security group get", bytes, secgroup_cb.RecordSecurityGroup{}, t)
} else {
t.Errorf("Can not test Security group get because Security group list is empty")
}
@ -794,20 +794,20 @@ func TestGetListCloudbroker(t *testing.T) {
// Storage policy
// List
bytes, err = client.CloudBroker().StoragePolicy().ListRaw(context.Background(), storagepolicy_cb.ListRequest{})
bytes, err = client.CloudBroker().StPolicy().ListRaw(context.Background(), stpolicy_cb.ListRequest{})
if err != nil {
t.Error(err)
}
getResult("Storage policy list", bytes, storagepolicy_cb.ListStoragePolicies{}, t)
getResult("Storage policy list", bytes, stpolicy_cb.ListStoragePolicies{}, t)
// Get
listStoragePolicies, _ := client.CloudBroker().StoragePolicy().List(context.Background(), storagepolicy_cb.ListRequest{})
listStoragePolicies, _ := client.CloudBroker().StPolicy().List(context.Background(), stpolicy_cb.ListRequest{})
if len(listStoragePolicies.Data) > 0 {
id := listStoragePolicies.Data[0].ID
bytes, err = client.CloudBroker().StoragePolicy().GetRaw(context.Background(), storagepolicy_cb.GetRequest{StoragePolicyID: id})
bytes, err = client.CloudBroker().StPolicy().GetRaw(context.Background(), stpolicy_cb.GetRequest{StoragePolicyID: id})
if err != nil {
t.Error(err)
}
getResult("Storage policy get", bytes, storagepolicy_cb.InfoStoragePolicy{}, t)
getResult("Storage policy get", bytes, stpolicy_cb.InfoStoragePolicy{}, t)
} else {
t.Errorf("Can not test Storage policy get because Storage policy list is empty")
}

@ -18,10 +18,10 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/pcidevice"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/prometheus"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/rg"
securitygroup "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/security_group"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/sep"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
storagepolicy "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/storage_policy"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/user"
@ -50,10 +50,10 @@ import (
pcidevice_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/pcidevice"
prometheus_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/prometheus"
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
securitygroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/security_group"
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
stack_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stack"
storagepolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/storage_policy"
stpolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
user_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/user"
@ -384,13 +384,13 @@ func getRequestsMapCloudAPI() map[string]interface{} {
"/restmachine/cloudapi/rg/removeDefNet": rg.RemoveDefNetRequest{},
// security_group
"/restmachine/cloudapi/security_group/create": securitygroup.CreateRequest{},
"/restmachine/cloudapi/security_group/create_rule": securitygroup.CreateRuleRequest{},
"/restmachine/cloudapi/security_group/delete": securitygroup.DeleteRequest{},
"/restmachine/cloudapi/security_group/delete_rule": securitygroup.DeleteRuleRequest{},
"/restmachine/cloudapi/security_group/get": securitygroup.GetRequest{},
"/restmachine/cloudapi/security_group/list": securitygroup.ListRequest{},
"/restmachine/cloudapi/security_group/update": securitygroup.UpdateRequest{},
"/restmachine/cloudapi/security_group/create": secgroup.CreateRequest{},
"/restmachine/cloudapi/security_group/create_rule": secgroup.CreateRuleRequest{},
"/restmachine/cloudapi/security_group/delete": secgroup.DeleteRequest{},
"/restmachine/cloudapi/security_group/delete_rule": secgroup.DeleteRuleRequest{},
"/restmachine/cloudapi/security_group/get": secgroup.GetRequest{},
"/restmachine/cloudapi/security_group/list": secgroup.ListRequest{},
"/restmachine/cloudapi/security_group/update": secgroup.UpdateRequest{},
// sep
"/restmachine/cloudapi/sep/listAvailableSepAndPools": sep.ListAvailableSEPAndPoolsRequest{},
@ -402,8 +402,8 @@ func getRequestsMapCloudAPI() map[string]interface{} {
"/restmachine/cloudapi/tasks/list": tasks.ListRequest{},
// storage policy
"/restmachine/cloudapi/storage_policy/get": storagepolicy.GetRequest{},
"/restmachine/cloudapi/storage_policy/list": storagepolicy.ListRequest{},
"/restmachine/cloudapi/storage_policy/get": stpolicy.GetRequest{},
"/restmachine/cloudapi/storage_policy/list": stpolicy.ListRequest{},
// trunk
"/restmachine/cloudapi/trunk/get": trunk.GetRequest{},
@ -588,6 +588,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/compute/migrateStorageAbort": compute_cb.MigrateStorageAbortRequest{},
"/restmachine/cloudbroker/compute/migrateStorageCleanup": compute_cb.MigrateStorageCleanUpRequest{},
"/restmachine/cloudbroker/compute/migrateStorageInfo": compute_cb.MigrateStorageInfoRequest{},
"/restmachine/cloudbroker/compute/migrate_storage_list": compute_cb.MigrateStorageListRequest{},
"/restmachine/cloudbroker/compute/moveToRg": compute_cb.MoveToRGRequest{},
"/restmachine/cloudbroker/compute/netAttach": compute_cb.NetAttachRequest{},
"/restmachine/cloudbroker/compute/netDetach": compute_cb.NetDetachRequest{},
@ -613,7 +614,9 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/compute/snapshotRollback": compute_cb.SnapshotRollbackRequest{},
"/restmachine/cloudbroker/compute/snapshotUsage": compute_cb.SnapshotUsageRequest{},
"/restmachine/cloudbroker/compute/start": compute_cb.StartRequest{},
"/restmachine/cloudbroker/compute/start_migration_in": compute_cb.StartMigrationINRequest{},
"/restmachine/cloudbroker/compute/stop": compute_cb.StopRequest{},
"/restmachine/cloudbroker/compute/stop_migration_in": compute_cb.StopMigrationINRequest{},
"/restmachine/cloudbroker/compute/tagAdd": compute_cb.TagAddRequest{},
"/restmachine/cloudbroker/compute/tagRemove": compute_cb.TagRemoveRequest{},
"/restmachine/cloudbroker/compute/unpinFromStack": compute_cb.UnpinFromStackRequest{},
@ -762,7 +765,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/image/rename": image_cb.RenameRequest{},
"/restmachine/cloudbroker/image/revokeAccess": image_cb.RevokeAccessRequest{},
"/restmachine/cloudbroker/image/share": image_cb.ShareRequest{},
"/restmachine/cloudbroker/image/updateNodes": image_cb.UpdateNodesRequest{},
// k8ci
"/restmachine/cloudbroker/k8ci/accessAdd": k8ci_cb.AccessAddRequest{},
@ -838,12 +840,14 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/lb/updateSysctlParams": lb_cb.UpdateSysctParamsRequest{},
// node
"/restmachine/cloudbroker/node/add_ssh_identity": node_cb.AddSSHIdentityRequest{},
"/restmachine/cloudbroker/node/applyIpmiAction": node_cb.ApplyIpmiActionRequest{},
"/restmachine/cloudbroker/node/consumption": node_cb.ConsumptionRequest{},
"/restmachine/cloudbroker/node/decommission": node_cb.DecommissionRequest{},
"/restmachine/cloudbroker/node/enable": node_cb.EnableRequest{},
"/restmachine/cloudbroker/node/enableNodes": node_cb.EnableNodesRequest{},
"/restmachine/cloudbroker/node/get": node_cb.GetRequest{},
"/restmachine/cloudbroker/node/get_ssh_identity": node_cb.GetSSHIdentityRequest{},
"/restmachine/cloudbroker/node/list": node_cb.ListRequest{},
"/restmachine/cloudbroker/node/maintenance": node_cb.MaintenanceRequest{},
"/restmachine/cloudbroker/node/restrict": node_cb.RestrictRequest{},
@ -914,13 +918,13 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/rg/removeDefNet": rg_cb.RemoveDefNetRequest{},
// security_group
"/restmachine/cloudbroker/security_group/create": securitygroup_cb.CreateRequest{},
"/restmachine/cloudbroker/security_group/create_rule": securitygroup_cb.CreateRuleRequest{},
"/restmachine/cloudbroker/security_group/delete": securitygroup_cb.DeleteRequest{},
"/restmachine/cloudbroker/security_group/delete_rule": securitygroup_cb.DeleteRuleRequest{},
"/restmachine/cloudbroker/security_group/get": securitygroup_cb.GetRequest{},
"/restmachine/cloudbroker/security_group/list": securitygroup_cb.ListRequest{},
"/restmachine/cloudbroker/security_group/update": securitygroup_cb.UpdateRequest{},
"/restmachine/cloudbroker/security_group/create": secgroup_cb.CreateRequest{},
"/restmachine/cloudbroker/security_group/create_rule": secgroup_cb.CreateRuleRequest{},
"/restmachine/cloudbroker/security_group/delete": secgroup_cb.DeleteRequest{},
"/restmachine/cloudbroker/security_group/delete_rule": secgroup_cb.DeleteRuleRequest{},
"/restmachine/cloudbroker/security_group/get": secgroup_cb.GetRequest{},
"/restmachine/cloudbroker/security_group/list": secgroup_cb.ListRequest{},
"/restmachine/cloudbroker/security_group/update": secgroup_cb.UpdateRequest{},
// sep
"/restmachine/cloudbroker/sep/accessGrant": sep_cb.AccessGrantRequest{},
@ -958,15 +962,15 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/stack/setMemAllocationRatio": stack_cb.SetMemAllocationRatioRequest{},
// storage_policy
"/restmachine/cloudbroker/storage_policy/get": storagepolicy_cb.GetRequest{},
"/restmachine/cloudbroker/storage_policy/list": storagepolicy_cb.ListRequest{},
"/restmachine/cloudbroker/storage_policy/create": storagepolicy_cb.CreateRequest{},
"/restmachine/cloudbroker/storage_policy/update": storagepolicy_cb.UpdateRequest{},
"/restmachine/cloudbroker/storage_policy/add_pool": storagepolicy_cb.AddPoolRequest{},
"/restmachine/cloudbroker/storage_policy/delete": storagepolicy_cb.DeleteRequest{},
"/restmachine/cloudbroker/storage_policy/disable": storagepolicy_cb.DisableRequest{},
"/restmachine/cloudbroker/storage_policy/enable": storagepolicy_cb.EnableRequest{},
"/restmachine/cloudbroker/storage_policy/delete_pool": storagepolicy_cb.DeletePollRequest{},
"/restmachine/cloudbroker/storage_policy/get": stpolicy_cb.GetRequest{},
"/restmachine/cloudbroker/storage_policy/list": stpolicy_cb.ListRequest{},
"/restmachine/cloudbroker/storage_policy/create": stpolicy_cb.CreateRequest{},
"/restmachine/cloudbroker/storage_policy/update": stpolicy_cb.UpdateRequest{},
"/restmachine/cloudbroker/storage_policy/add_pool": stpolicy_cb.AddPoolRequest{},
"/restmachine/cloudbroker/storage_policy/delete": stpolicy_cb.DeleteRequest{},
"/restmachine/cloudbroker/storage_policy/disable": stpolicy_cb.DisableRequest{},
"/restmachine/cloudbroker/storage_policy/enable": stpolicy_cb.EnableRequest{},
"/restmachine/cloudbroker/storage_policy/delete_pool": stpolicy_cb.DeletePoolRequest{},
// tasks
"/restmachine/cloudbroker/tasks/get": tasks_cb.GetRequest{},

@ -47,6 +47,7 @@ var DEPRECATED_GROUPS = []string{
"/cloudbroker/compute/affinityGroupCheckStart",
"/cloudbroker/vins/staticRouteAccessGrant",
"/cloudbroker/vins/staticRouteAccessRevoke",
"/restmachine/cloudbroker/image/updateNodes",
}
// getUrlsFromBytes converts bytes to array of urls strings

Loading…
Cancel
Save