From abd35f858c1de4e04da93139b36037edf5afbaa2 Mon Sep 17 00:00:00 2001 From: dayterr Date: Thu, 11 Sep 2025 15:56:44 +0300 Subject: [PATCH] v1.12.3 --- CHANGELOG.md | 156 +++--------------- README.md | 12 +- pkg/cloudapi/account/models.go | 18 +- pkg/cloudapi/compute/filter_test.go | 4 - pkg/cloudapi/compute/models.go | 18 +- pkg/cloudapi/compute/redeploy.go | 4 + pkg/cloudapi/compute/update.go | 4 + pkg/cloudapi/disks/list.go | 4 + pkg/cloudapi/disks/list_unattached.go | 4 + pkg/cloudapi/kvmx86/create.go | 4 + pkg/cloudapi/kvmx86/create_blank.go | 4 + pkg/cloudapi/rg/create.go | 4 +- .../{security_group => secgroup}/create.go | 2 +- .../create_rule.go | 2 +- .../{security_group => secgroup}/delete.go | 2 +- .../delete_rule.go | 2 +- .../{security_group => secgroup}/filter.go | 2 +- .../secgroup}/filter_test.go | 2 +- .../{security_group => secgroup}/get.go | 2 +- .../{security_group => secgroup}/list.go | 2 +- pkg/cloudapi/secgroup/models.go | 94 +++++++++++ .../security_group.go | 2 +- .../{security_group => secgroup}/sorting.go | 2 +- .../{security_group => secgroup}/update.go | 2 +- pkg/cloudapi/security_group/models.go | 43 ----- pkg/cloudapi/securitygroup.go | 6 +- pkg/cloudapi/storage_policy.go | 10 ++ pkg/cloudapi/storage_policy/models.go | 40 ----- pkg/cloudapi/storagepolicy.go | 10 -- .../{storage_policy => stpolicy}/get.go | 6 +- .../{storage_policy => stpolicy}/list.go | 6 +- pkg/cloudapi/stpolicy/models.go | 82 +++++++++ .../storage_policy.go | 8 +- pkg/cloudbroker/account/create.go | 6 +- pkg/cloudbroker/account/filter_test.go | 3 - pkg/cloudbroker/account/models.go | 20 ++- pkg/cloudbroker/compute/filter_test.go | 8 - pkg/cloudbroker/compute/list.go | 4 - .../compute/migrate_storage_list.go | 55 ++++++ pkg/cloudbroker/compute/models.go | 46 ++++-- pkg/cloudbroker/compute/redeploy.go | 4 + pkg/cloudbroker/compute/start_migration_in.go | 36 ++++ pkg/cloudbroker/compute/stop_migration_in.go | 36 ++++ pkg/cloudbroker/compute/update.go | 4 + pkg/cloudbroker/disks/list.go | 4 + pkg/cloudbroker/disks/list_unattached.go | 4 + pkg/cloudbroker/image/update_nodes.go | 42 ----- pkg/cloudbroker/kvmx86/create.go | 4 + pkg/cloudbroker/kvmx86/create_blank.go | 4 + pkg/cloudbroker/kvmx86/mass_create.go | 4 + pkg/cloudbroker/node/add_ssh_identity.go | 54 ++++++ pkg/cloudbroker/node/get_ssh_identity.go | 39 +++++ pkg/cloudbroker/node/models.go | 12 ++ pkg/cloudbroker/rg/create.go | 4 +- .../{security_group => secgroup}/create.go | 2 +- .../create_rule.go | 2 +- .../{security_group => secgroup}/delete.go | 2 +- .../delete_rule.go | 2 +- .../{security_group => secgroup}/filter.go | 2 +- .../secgroup}/filter_test.go | 2 +- .../{security_group => secgroup}/get.go | 2 +- .../{security_group => secgroup}/list.go | 2 +- pkg/cloudbroker/secgroup/models.go | 94 +++++++++++ .../security_group.go | 2 +- .../{security_group => secgroup}/sorting.go | 2 +- .../{security_group => secgroup}/update.go | 2 +- pkg/cloudbroker/security_group/models.go | 43 ----- pkg/cloudbroker/securitygroup.go | 6 +- pkg/cloudbroker/storage_policy.go | 10 ++ pkg/cloudbroker/storage_policy/models.go | 51 ------ pkg/cloudbroker/storagepolicy.go | 10 -- .../{storage_policy => stpolicy}/add_pool.go | 8 +- .../{storage_policy => stpolicy}/create.go | 10 +- .../{storage_policy => stpolicy}/delete.go | 4 +- .../delete_pool.go | 10 +- .../{storage_policy => stpolicy}/disable.go | 4 +- .../{storage_policy => stpolicy}/enable.go | 4 +- .../{storage_policy => stpolicy}/filter.go | 2 +- .../filter_test.go | 20 +-- .../{storage_policy => stpolicy}/get.go | 6 +- .../{storage_policy => stpolicy}/list.go | 6 +- pkg/cloudbroker/stpolicy/models.go | 108 ++++++++++++ .../storage_policy.go | 8 +- .../{storage_policy => stpolicy}/update.go | 6 +- tests/platform_upgrade/cloud_test.go | 48 +++--- tests/platform_upgrade/request_map.go | 64 +++---- tests/platform_upgrade/utils_urls.go | 1 + 87 files changed, 930 insertions(+), 571 deletions(-) rename pkg/cloudapi/{security_group => secgroup}/create.go (98%) rename pkg/cloudapi/{security_group => secgroup}/create_rule.go (98%) rename pkg/cloudapi/{security_group => secgroup}/delete.go (97%) rename pkg/cloudapi/{security_group => secgroup}/delete_rule.go (97%) rename pkg/cloudapi/{security_group => secgroup}/filter.go (99%) rename pkg/{cloudbroker/security_group => cloudapi/secgroup}/filter_test.go (98%) rename pkg/cloudapi/{security_group => secgroup}/get.go (97%) rename pkg/cloudapi/{security_group => secgroup}/list.go (99%) create mode 100644 pkg/cloudapi/secgroup/models.go rename pkg/cloudapi/{security_group => secgroup}/security_group.go (93%) rename pkg/cloudapi/{security_group => secgroup}/sorting.go (97%) rename pkg/cloudapi/{security_group => secgroup}/update.go (98%) delete mode 100644 pkg/cloudapi/security_group/models.go create mode 100644 pkg/cloudapi/storage_policy.go delete mode 100644 pkg/cloudapi/storage_policy/models.go delete mode 100644 pkg/cloudapi/storagepolicy.go rename pkg/cloudapi/{storage_policy => stpolicy}/get.go (78%) rename pkg/cloudapi/{storage_policy => stpolicy}/list.go (91%) create mode 100644 pkg/cloudapi/stpolicy/models.go rename pkg/cloudapi/{storage_policy => stpolicy}/storage_policy.go (61%) create mode 100644 pkg/cloudbroker/compute/migrate_storage_list.go create mode 100644 pkg/cloudbroker/compute/start_migration_in.go create mode 100644 pkg/cloudbroker/compute/stop_migration_in.go delete mode 100644 pkg/cloudbroker/image/update_nodes.go create mode 100644 pkg/cloudbroker/node/add_ssh_identity.go create mode 100644 pkg/cloudbroker/node/get_ssh_identity.go rename pkg/cloudbroker/{security_group => secgroup}/create.go (98%) rename pkg/cloudbroker/{security_group => secgroup}/create_rule.go (98%) rename pkg/cloudbroker/{security_group => secgroup}/delete.go (97%) rename pkg/cloudbroker/{security_group => secgroup}/delete_rule.go (97%) rename pkg/cloudbroker/{security_group => secgroup}/filter.go (99%) rename pkg/{cloudapi/security_group => cloudbroker/secgroup}/filter_test.go (98%) rename pkg/cloudbroker/{security_group => secgroup}/get.go (97%) rename pkg/cloudbroker/{security_group => secgroup}/list.go (99%) create mode 100644 pkg/cloudbroker/secgroup/models.go rename pkg/cloudbroker/{security_group => secgroup}/security_group.go (93%) rename pkg/cloudbroker/{security_group => secgroup}/sorting.go (97%) rename pkg/cloudbroker/{security_group => secgroup}/update.go (98%) delete mode 100644 pkg/cloudbroker/security_group/models.go create mode 100644 pkg/cloudbroker/storage_policy.go delete mode 100644 pkg/cloudbroker/storage_policy/models.go delete mode 100644 pkg/cloudbroker/storagepolicy.go rename pkg/cloudbroker/{storage_policy => stpolicy}/add_pool.go (76%) rename pkg/cloudbroker/{storage_policy => stpolicy}/create.go (80%) rename pkg/cloudbroker/{storage_policy => stpolicy}/delete.go (86%) rename pkg/cloudbroker/{storage_policy => stpolicy}/delete_pool.go (73%) rename pkg/cloudbroker/{storage_policy => stpolicy}/disable.go (86%) rename pkg/cloudbroker/{storage_policy => stpolicy}/enable.go (86%) rename pkg/cloudbroker/{storage_policy => stpolicy}/filter.go (98%) rename pkg/cloudbroker/{storage_policy => stpolicy}/filter_test.go (87%) rename pkg/cloudbroker/{storage_policy => stpolicy}/get.go (78%) rename pkg/cloudbroker/{storage_policy => stpolicy}/list.go (91%) create mode 100644 pkg/cloudbroker/stpolicy/models.go rename pkg/cloudbroker/{storage_policy => stpolicy}/storage_policy.go (61%) rename pkg/cloudbroker/{storage_policy => stpolicy}/update.go (84%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec814d5..4536d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,183 +1,75 @@ -## Version 1.12.2 +## Version 1.12.3 ### Добавлено -#### общие изменения -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-525 | Поддержка работы с различными сontent-type | -| BGOS-514 | Пакет SDN со структурой для SDN запросов | -| BGOS-587 | Проверка срока действия и обновления JWT токена для `DecortClient`, в связи с добавлением срока действия токена | - #### account | Идентификатор
задачи | Описание | | --- | --- | -| 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 -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-595 | Поле `CorrelationID` в структуры ответа `RecordAudit` в cloudapi/audit и в `RecordAudit` и `ItemAudit` в cloudbroker/audit | - -#### bservice -| Идентификатор
задачи | Описание | -| --- | --- | -| 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 | Идентификатор
задачи | Описание | | --- | --- | -| 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 | Идентификатор
задачи | Описание | | --- | --- | -| 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 -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-584 | Опциональное поле `EnableSecGroups` в структуру запроса `UpdateRequest` в cloudbroker/dpdknet | -| BGOS-584 | Поле `EnableSecGroups` в структуры ответа `ItemDPDKNet`, `RecordDPDKNet` в cloudapi/dpdknet и в cloudbroker/dpdknet | - -#### extnet -| Идентификатор
задачи | Описание | -| --- | --- | -| 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 -| Идентификатор
задачи | Описание | -| --- | --- | -| 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 -| Идентификатор
задачи | Описание | -| --- | --- | -| 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 | Идентификатор
задачи | Описание | | --- | --- | -| 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 -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-585 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudapi/lb и в cloudbroker/lb | +| BGOS-603 | Опциональное поле `OSVersion` в структуры запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/compute и cloudbroker/compute | +| BGOS-603 | Опциональное поле `OSVersion` в структуру запроса `MassCreateRequest` в cloudbroker/compute | #### node | Идентификатор
задачи | Описание | | --- | --- | -| BGOS-597 | Поле `VCPU` в структуру ответа `FreeResourcesInfo` в cloudbroker/node | - -#### rg -| Идентификатор
задачи | Описание | -| --- | --- | -| 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 | Идентификатор
задачи | Описание | | --- | --- | -| BGOS-582 | Группа ручек `security_group` в cloudapi и в cloudbroker | +| BGOS-601 | Добавлены комментарии к структурам ответов | #### storage policy | Идентификатор
задачи | Описание | | --- | --- | -| BGOS-571 | Группа ручек `storage_policy` в cloudapi и в cloudbroker | - -#### trunk -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-565 | Опциональное поле `Status` в структуру запроса `ListRequest` в cloudapi/trunk и в cloudbroker/trunk | - -#### user -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-562 | Опциональное поле `AccountID` в структуру запроса `CreateVirtualRequest` в cloudapi/image и в cloudbroker/image | - -#### vins -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-584 | Метод `Update` и структура запроса `UpdateRequest` в cloudbroker/vins | -| BGOS-584 | Поле `EnableSecGroups` в структуру ответа `ItemVINS` в cloudbroker/vins | -| BGOS-584 | Поле `EnableSecGroups` в структуру ответа `RecordVINS` в cloudapi/vins и в cloudbroker/vins | - -#### SDN access groups -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-514 | Группа api access_groups | +| BGOS-598 | Поле `sep_name` в структуре ответа `AccessSEPPool` в cloudapi/stpolicy и в cloudbroker/stpolicy | +| BGOS-600 | Добавлены комментарии к структурам ответов | ### Исправлено -#### compute -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-569 | Изменена структура ответа с `ListAudits` на `*ListAudits`, содержащую поля `Data` и `EntryCount` в методе `Audits` в cloudapi/compute | -| BGOS-569 | Изменена структура ответа с `ListDetailedAudits` на `*ListDetailedAudits`, содержащую поля `Data` и `EntryCount` в методе `Audits` в cloudbroker/compute | - -#### user +#### account | Идентификатор
задачи | Описание | | --- | --- | -| BGOS-561 | Изменен тип поля `UserIDs` с stirng на []string в структуре запроса `DeleteUsersRequest` в cloudbroker/user | +| BGOS-607 | Поле `StoragePolicies` в структуре запроса `CreateRequest` стало опциональным в cloudbroker/account | +| BGOS-607 | Изменен тип поля `ID` в структуре запроса `StoragePolicy` с int64 на uint64 в cloudbroker/account | -#### vins +#### rg | Идентификатор
задачи | Описание | | --- | --- | -| 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 | Идентификатор
задачи | Описание | | --- | --- | -| BGOS-563 | Опциональное поле `Drivers` в структуре запроса `FromPlatformDiskRequest` в cloudapi/disks и cloudbroker/disks | +| BGOS-605 | Поле `CKey` из структуры ответа `RecordAccount` в cloudapi/account и поля `CKey` из структуры ответа `InfoAccount` и `Meta` из структуры ответа `ItemAccount` в cloudbroker/account | #### compute | Идентификатор
задачи | Описание | | --- | --- | -| 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 | Идентификатор
задачи | Описание | | --- | --- | -| BGOS-563 | Опциональное поле `Drivers` в структуре запроса `CreateRequest` в cloudapi/image и cloudbroker/image | -| BGOS-563 | Опциональное поле `Drivers` в структуре запроса `CreateCDROMImageRequest` в cloudbroker/image | - -#### k8ci -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-563 | Опциональные поля `MasterDriver` и `WorkerDriver` в структурах запроса `ListRequest` и `ListDeletedRequest` в cloudapi/k8ci и cloudbroker/k8ci | -| BGOS-563 | Опциональные поля `MasterDriver` и `WorkerDriver` в структуре запроса `CreateRequest` в cloudbroker/k8ci | - -#### kvmx86 -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-563 | Опциональное поле `Driver` в структурах запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 и cloudbroker/kvmx86 | \ No newline at end of file +| BGOS-604 | Метод `UpdateNodes` и структура запроса `UpdateNodesRequest` в cloudbroker/image | diff --git a/README.md b/README.md index cdc5fed..b9ac72a 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/pkg/cloudapi/account/models.go b/pkg/cloudapi/account/models.go index 16c14a9..f72e377 100644 --- a/pkg/cloudapi/account/models.go +++ b/pkg/cloudapi/account/models.go @@ -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"` diff --git a/pkg/cloudapi/compute/filter_test.go b/pkg/cloudapi/compute/filter_test.go index 34095bf..0afb05f 100644 --- a/pkg/cloudapi/compute/filter_test.go +++ b/pkg/cloudapi/compute/filter_test.go @@ -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, }, }, diff --git a/pkg/cloudapi/compute/models.go b/pkg/cloudapi/compute/models.go index 68e1a6a..793281d 100644 --- a/pkg/cloudapi/compute/models.go +++ b/pkg/cloudapi/compute/models.go @@ -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"` } diff --git a/pkg/cloudapi/compute/redeploy.go b/pkg/cloudapi/compute/redeploy.go index a170b5b..d603d88 100644 --- a/pkg/cloudapi/compute/redeploy.go +++ b/pkg/cloudapi/compute/redeploy.go @@ -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 diff --git a/pkg/cloudapi/compute/update.go b/pkg/cloudapi/compute/update.go index ba7b29f..3d33b97 100644 --- a/pkg/cloudapi/compute/update.go +++ b/pkg/cloudapi/compute/update.go @@ -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 diff --git a/pkg/cloudapi/disks/list.go b/pkg/cloudapi/disks/list.go index 54eb2a2..6799816 100644 --- a/pkg/cloudapi/disks/list.go +++ b/pkg/cloudapi/disks/list.go @@ -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"` diff --git a/pkg/cloudapi/disks/list_unattached.go b/pkg/cloudapi/disks/list_unattached.go index e038861..df00642 100644 --- a/pkg/cloudapi/disks/list_unattached.go +++ b/pkg/cloudapi/disks/list_unattached.go @@ -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"` diff --git a/pkg/cloudapi/kvmx86/create.go b/pkg/cloudapi/kvmx86/create.go index 48c7c2b..f1eae25 100644 --- a/pkg/cloudapi/kvmx86/create.go +++ b/pkg/cloudapi/kvmx86/create.go @@ -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"` diff --git a/pkg/cloudapi/kvmx86/create_blank.go b/pkg/cloudapi/kvmx86/create_blank.go index 44f3898..c935765 100644 --- a/pkg/cloudapi/kvmx86/create_blank.go +++ b/pkg/cloudapi/kvmx86/create_blank.go @@ -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 diff --git a/pkg/cloudapi/rg/create.go b/pkg/cloudapi/rg/create.go index b76fe7d..d98fa07 100644 --- a/pkg/cloudapi/rg/create.go +++ b/pkg/cloudapi/rg/create.go @@ -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 diff --git a/pkg/cloudapi/security_group/create.go b/pkg/cloudapi/secgroup/create.go similarity index 98% rename from pkg/cloudapi/security_group/create.go rename to pkg/cloudapi/secgroup/create.go index 1bab28a..734f2be 100644 --- a/pkg/cloudapi/security_group/create.go +++ b/pkg/cloudapi/secgroup/create.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/security_group/create_rule.go b/pkg/cloudapi/secgroup/create_rule.go similarity index 98% rename from pkg/cloudapi/security_group/create_rule.go rename to pkg/cloudapi/secgroup/create_rule.go index 1d56db4..641b632 100644 --- a/pkg/cloudapi/security_group/create_rule.go +++ b/pkg/cloudapi/secgroup/create_rule.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/security_group/delete.go b/pkg/cloudapi/secgroup/delete.go similarity index 97% rename from pkg/cloudapi/security_group/delete.go rename to pkg/cloudapi/secgroup/delete.go index cd6eea55..2a9d50e 100644 --- a/pkg/cloudapi/security_group/delete.go +++ b/pkg/cloudapi/secgroup/delete.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/security_group/delete_rule.go b/pkg/cloudapi/secgroup/delete_rule.go similarity index 97% rename from pkg/cloudapi/security_group/delete_rule.go rename to pkg/cloudapi/secgroup/delete_rule.go index 4491900..07daef6 100644 --- a/pkg/cloudapi/security_group/delete_rule.go +++ b/pkg/cloudapi/secgroup/delete_rule.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/security_group/filter.go b/pkg/cloudapi/secgroup/filter.go similarity index 99% rename from pkg/cloudapi/security_group/filter.go rename to pkg/cloudapi/secgroup/filter.go index e95ee28..6a03da3 100644 --- a/pkg/cloudapi/security_group/filter.go +++ b/pkg/cloudapi/secgroup/filter.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup // FilterByID returns ListSecurityGroups with specified ID. func (lsg ListSecurityGroups) FilterByID(id uint64) ListSecurityGroups { diff --git a/pkg/cloudbroker/security_group/filter_test.go b/pkg/cloudapi/secgroup/filter_test.go similarity index 98% rename from pkg/cloudbroker/security_group/filter_test.go rename to pkg/cloudapi/secgroup/filter_test.go index 821f016..2231f60 100644 --- a/pkg/cloudbroker/security_group/filter_test.go +++ b/pkg/cloudapi/secgroup/filter_test.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import "testing" diff --git a/pkg/cloudapi/security_group/get.go b/pkg/cloudapi/secgroup/get.go similarity index 97% rename from pkg/cloudapi/security_group/get.go rename to pkg/cloudapi/secgroup/get.go index 318dd6b..bda9833 100644 --- a/pkg/cloudapi/security_group/get.go +++ b/pkg/cloudapi/secgroup/get.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/security_group/list.go b/pkg/cloudapi/secgroup/list.go similarity index 99% rename from pkg/cloudapi/security_group/list.go rename to pkg/cloudapi/secgroup/list.go index 0e5fb37..c7f22c1 100644 --- a/pkg/cloudapi/security_group/list.go +++ b/pkg/cloudapi/secgroup/list.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/secgroup/models.go b/pkg/cloudapi/secgroup/models.go new file mode 100644 index 0000000..766d731 --- /dev/null +++ b/pkg/cloudapi/secgroup/models.go @@ -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"` +} diff --git a/pkg/cloudapi/security_group/security_group.go b/pkg/cloudapi/secgroup/security_group.go similarity index 93% rename from pkg/cloudapi/security_group/security_group.go rename to pkg/cloudapi/secgroup/security_group.go index 35c6a3b..3505ecd 100644 --- a/pkg/cloudapi/security_group/security_group.go +++ b/pkg/cloudapi/secgroup/security_group.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces" diff --git a/pkg/cloudapi/security_group/sorting.go b/pkg/cloudapi/secgroup/sorting.go similarity index 97% rename from pkg/cloudapi/security_group/sorting.go rename to pkg/cloudapi/secgroup/sorting.go index 5a54b53..57df52b 100644 --- a/pkg/cloudapi/security_group/sorting.go +++ b/pkg/cloudapi/secgroup/sorting.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import "sort" diff --git a/pkg/cloudapi/security_group/update.go b/pkg/cloudapi/secgroup/update.go similarity index 98% rename from pkg/cloudapi/security_group/update.go rename to pkg/cloudapi/secgroup/update.go index c1e373f..5fdb5af 100644 --- a/pkg/cloudapi/security_group/update.go +++ b/pkg/cloudapi/secgroup/update.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudapi/security_group/models.go b/pkg/cloudapi/security_group/models.go deleted file mode 100644 index 440e813..0000000 --- a/pkg/cloudapi/security_group/models.go +++ /dev/null @@ -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"` -} diff --git a/pkg/cloudapi/securitygroup.go b/pkg/cloudapi/securitygroup.go index 0ae85c6..3471221 100644 --- a/pkg/cloudapi/securitygroup.go +++ b/pkg/cloudapi/securitygroup.go @@ -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) } diff --git a/pkg/cloudapi/storage_policy.go b/pkg/cloudapi/storage_policy.go new file mode 100644 index 0000000..5df6d24 --- /dev/null +++ b/pkg/cloudapi/storage_policy.go @@ -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) +} diff --git a/pkg/cloudapi/storage_policy/models.go b/pkg/cloudapi/storage_policy/models.go deleted file mode 100644 index 82d45b8..0000000 --- a/pkg/cloudapi/storage_policy/models.go +++ /dev/null @@ -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"` -} diff --git a/pkg/cloudapi/storagepolicy.go b/pkg/cloudapi/storagepolicy.go deleted file mode 100644 index 9f8b288..0000000 --- a/pkg/cloudapi/storagepolicy.go +++ /dev/null @@ -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) -} diff --git a/pkg/cloudapi/storage_policy/get.go b/pkg/cloudapi/stpolicy/get.go similarity index 78% rename from pkg/cloudapi/storage_policy/get.go rename to pkg/cloudapi/stpolicy/get.go index 5619ed9..c506b90 100644 --- a/pkg/cloudapi/storage_policy/get.go +++ b/pkg/cloudapi/stpolicy/get.go @@ -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)) diff --git a/pkg/cloudapi/storage_policy/list.go b/pkg/cloudapi/stpolicy/list.go similarity index 91% rename from pkg/cloudapi/storage_policy/list.go rename to pkg/cloudapi/stpolicy/list.go index 330afb5..67d4293 100644 --- a/pkg/cloudapi/storage_policy/list.go +++ b/pkg/cloudapi/stpolicy/list.go @@ -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)) diff --git a/pkg/cloudapi/stpolicy/models.go b/pkg/cloudapi/stpolicy/models.go new file mode 100644 index 0000000..954a6eb --- /dev/null +++ b/pkg/cloudapi/stpolicy/models.go @@ -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"` +} diff --git a/pkg/cloudapi/storage_policy/storage_policy.go b/pkg/cloudapi/stpolicy/storage_policy.go similarity index 61% rename from pkg/cloudapi/storage_policy/storage_policy.go rename to pkg/cloudapi/stpolicy/storage_policy.go index 42b42a2..6b6d61f 100644 --- a/pkg/cloudapi/storage_policy/storage_policy.go +++ b/pkg/cloudapi/stpolicy/storage_policy.go @@ -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, } } diff --git a/pkg/cloudbroker/account/create.go b/pkg/cloudbroker/account/create.go index fee5f2e..a45cc3e 100644 --- a/pkg/cloudbroker/account/create.go +++ b/pkg/cloudbroker/account/create.go @@ -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 diff --git a/pkg/cloudbroker/account/filter_test.go b/pkg/cloudbroker/account/filter_test.go index 301d69f..c8ccae9 100644 --- a/pkg/cloudbroker/account/filter_test.go +++ b/pkg/cloudbroker/account/filter_test.go @@ -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, diff --git a/pkg/cloudbroker/account/models.go b/pkg/cloudbroker/account/models.go index 35625b7..0e4c507 100644 --- a/pkg/cloudbroker/account/models.go +++ b/pkg/cloudbroker/account/models.go @@ -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"` diff --git a/pkg/cloudbroker/compute/filter_test.go b/pkg/cloudbroker/compute/filter_test.go index cca037f..10a9a4f 100644 --- a/pkg/cloudbroker/compute/filter_test.go +++ b/pkg/cloudbroker/compute/filter_test.go @@ -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, }, }, }, diff --git a/pkg/cloudbroker/compute/list.go b/pkg/cloudbroker/compute/list.go index 80b0ccd..ba1a98f 100644 --- a/pkg/cloudbroker/compute/list.go +++ b/pkg/cloudbroker/compute/list.go @@ -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"` diff --git a/pkg/cloudbroker/compute/migrate_storage_list.go b/pkg/cloudbroker/compute/migrate_storage_list.go new file mode 100644 index 0000000..50fee10 --- /dev/null +++ b/pkg/cloudbroker/compute/migrate_storage_list.go @@ -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 +} diff --git a/pkg/cloudbroker/compute/models.go b/pkg/cloudbroker/compute/models.go index a35f205..323a735 100644 --- a/pkg/cloudbroker/compute/models.go +++ b/pkg/cloudbroker/compute/models.go @@ -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"` +} diff --git a/pkg/cloudbroker/compute/redeploy.go b/pkg/cloudbroker/compute/redeploy.go index e9e43a7..8612b56 100644 --- a/pkg/cloudbroker/compute/redeploy.go +++ b/pkg/cloudbroker/compute/redeploy.go @@ -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"` diff --git a/pkg/cloudbroker/compute/start_migration_in.go b/pkg/cloudbroker/compute/start_migration_in.go new file mode 100644 index 0000000..3f673f1 --- /dev/null +++ b/pkg/cloudbroker/compute/start_migration_in.go @@ -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 +} diff --git a/pkg/cloudbroker/compute/stop_migration_in.go b/pkg/cloudbroker/compute/stop_migration_in.go new file mode 100644 index 0000000..6b732bb --- /dev/null +++ b/pkg/cloudbroker/compute/stop_migration_in.go @@ -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 +} diff --git a/pkg/cloudbroker/compute/update.go b/pkg/cloudbroker/compute/update.go index 5a2ebfa..58a5331 100644 --- a/pkg/cloudbroker/compute/update.go +++ b/pkg/cloudbroker/compute/update.go @@ -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 diff --git a/pkg/cloudbroker/disks/list.go b/pkg/cloudbroker/disks/list.go index 46b657a..abec582 100644 --- a/pkg/cloudbroker/disks/list.go +++ b/pkg/cloudbroker/disks/list.go @@ -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"` diff --git a/pkg/cloudbroker/disks/list_unattached.go b/pkg/cloudbroker/disks/list_unattached.go index 67be75a..dcee451 100644 --- a/pkg/cloudbroker/disks/list_unattached.go +++ b/pkg/cloudbroker/disks/list_unattached.go @@ -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"` diff --git a/pkg/cloudbroker/image/update_nodes.go b/pkg/cloudbroker/image/update_nodes.go deleted file mode 100644 index 3587ca3..0000000 --- a/pkg/cloudbroker/image/update_nodes.go +++ /dev/null @@ -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 -} diff --git a/pkg/cloudbroker/kvmx86/create.go b/pkg/cloudbroker/kvmx86/create.go index 44138e1..5f3e537 100644 --- a/pkg/cloudbroker/kvmx86/create.go +++ b/pkg/cloudbroker/kvmx86/create.go @@ -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"` diff --git a/pkg/cloudbroker/kvmx86/create_blank.go b/pkg/cloudbroker/kvmx86/create_blank.go index ca87665..558fa26 100644 --- a/pkg/cloudbroker/kvmx86/create_blank.go +++ b/pkg/cloudbroker/kvmx86/create_blank.go @@ -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 diff --git a/pkg/cloudbroker/kvmx86/mass_create.go b/pkg/cloudbroker/kvmx86/mass_create.go index fa8997b..1a28074 100644 --- a/pkg/cloudbroker/kvmx86/mass_create.go +++ b/pkg/cloudbroker/kvmx86/mass_create.go @@ -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 { diff --git a/pkg/cloudbroker/node/add_ssh_identity.go b/pkg/cloudbroker/node/add_ssh_identity.go new file mode 100644 index 0000000..f1dc5cd --- /dev/null +++ b/pkg/cloudbroker/node/add_ssh_identity.go @@ -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 +} diff --git a/pkg/cloudbroker/node/get_ssh_identity.go b/pkg/cloudbroker/node/get_ssh_identity.go new file mode 100644 index 0000000..084b039 --- /dev/null +++ b/pkg/cloudbroker/node/get_ssh_identity.go @@ -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 +} diff --git a/pkg/cloudbroker/node/models.go b/pkg/cloudbroker/node/models.go index abe123e..d3761af 100644 --- a/pkg/cloudbroker/node/models.go +++ b/pkg/cloudbroker/node/models.go @@ -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"` +} diff --git a/pkg/cloudbroker/rg/create.go b/pkg/cloudbroker/rg/create.go index ae30cd5..f03463f 100644 --- a/pkg/cloudbroker/rg/create.go +++ b/pkg/cloudbroker/rg/create.go @@ -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 diff --git a/pkg/cloudbroker/security_group/create.go b/pkg/cloudbroker/secgroup/create.go similarity index 98% rename from pkg/cloudbroker/security_group/create.go rename to pkg/cloudbroker/secgroup/create.go index dfe2407..1487829 100644 --- a/pkg/cloudbroker/security_group/create.go +++ b/pkg/cloudbroker/secgroup/create.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/security_group/create_rule.go b/pkg/cloudbroker/secgroup/create_rule.go similarity index 98% rename from pkg/cloudbroker/security_group/create_rule.go rename to pkg/cloudbroker/secgroup/create_rule.go index f7be1d0..e6cc0a4 100644 --- a/pkg/cloudbroker/security_group/create_rule.go +++ b/pkg/cloudbroker/secgroup/create_rule.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/security_group/delete.go b/pkg/cloudbroker/secgroup/delete.go similarity index 97% rename from pkg/cloudbroker/security_group/delete.go rename to pkg/cloudbroker/secgroup/delete.go index 4538a6f..a306baa 100644 --- a/pkg/cloudbroker/security_group/delete.go +++ b/pkg/cloudbroker/secgroup/delete.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/security_group/delete_rule.go b/pkg/cloudbroker/secgroup/delete_rule.go similarity index 97% rename from pkg/cloudbroker/security_group/delete_rule.go rename to pkg/cloudbroker/secgroup/delete_rule.go index 9609cec..1bc4daa 100644 --- a/pkg/cloudbroker/security_group/delete_rule.go +++ b/pkg/cloudbroker/secgroup/delete_rule.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/security_group/filter.go b/pkg/cloudbroker/secgroup/filter.go similarity index 99% rename from pkg/cloudbroker/security_group/filter.go rename to pkg/cloudbroker/secgroup/filter.go index e95ee28..6a03da3 100644 --- a/pkg/cloudbroker/security_group/filter.go +++ b/pkg/cloudbroker/secgroup/filter.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup // FilterByID returns ListSecurityGroups with specified ID. func (lsg ListSecurityGroups) FilterByID(id uint64) ListSecurityGroups { diff --git a/pkg/cloudapi/security_group/filter_test.go b/pkg/cloudbroker/secgroup/filter_test.go similarity index 98% rename from pkg/cloudapi/security_group/filter_test.go rename to pkg/cloudbroker/secgroup/filter_test.go index 821f016..2231f60 100644 --- a/pkg/cloudapi/security_group/filter_test.go +++ b/pkg/cloudbroker/secgroup/filter_test.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import "testing" diff --git a/pkg/cloudbroker/security_group/get.go b/pkg/cloudbroker/secgroup/get.go similarity index 97% rename from pkg/cloudbroker/security_group/get.go rename to pkg/cloudbroker/secgroup/get.go index 2b92d03..a126c07 100644 --- a/pkg/cloudbroker/security_group/get.go +++ b/pkg/cloudbroker/secgroup/get.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/security_group/list.go b/pkg/cloudbroker/secgroup/list.go similarity index 99% rename from pkg/cloudbroker/security_group/list.go rename to pkg/cloudbroker/secgroup/list.go index ab13a28..139cc0c 100644 --- a/pkg/cloudbroker/security_group/list.go +++ b/pkg/cloudbroker/secgroup/list.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/secgroup/models.go b/pkg/cloudbroker/secgroup/models.go new file mode 100644 index 0000000..766d731 --- /dev/null +++ b/pkg/cloudbroker/secgroup/models.go @@ -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"` +} diff --git a/pkg/cloudbroker/security_group/security_group.go b/pkg/cloudbroker/secgroup/security_group.go similarity index 93% rename from pkg/cloudbroker/security_group/security_group.go rename to pkg/cloudbroker/secgroup/security_group.go index 35c6a3b..3505ecd 100644 --- a/pkg/cloudbroker/security_group/security_group.go +++ b/pkg/cloudbroker/secgroup/security_group.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces" diff --git a/pkg/cloudbroker/security_group/sorting.go b/pkg/cloudbroker/secgroup/sorting.go similarity index 97% rename from pkg/cloudbroker/security_group/sorting.go rename to pkg/cloudbroker/secgroup/sorting.go index 5a54b53..57df52b 100644 --- a/pkg/cloudbroker/security_group/sorting.go +++ b/pkg/cloudbroker/secgroup/sorting.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import "sort" diff --git a/pkg/cloudbroker/security_group/update.go b/pkg/cloudbroker/secgroup/update.go similarity index 98% rename from pkg/cloudbroker/security_group/update.go rename to pkg/cloudbroker/secgroup/update.go index 0e6835e..4201046 100644 --- a/pkg/cloudbroker/security_group/update.go +++ b/pkg/cloudbroker/secgroup/update.go @@ -1,4 +1,4 @@ -package securitygroup +package secgroup import ( "context" diff --git a/pkg/cloudbroker/security_group/models.go b/pkg/cloudbroker/security_group/models.go deleted file mode 100644 index 440e813..0000000 --- a/pkg/cloudbroker/security_group/models.go +++ /dev/null @@ -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"` -} diff --git a/pkg/cloudbroker/securitygroup.go b/pkg/cloudbroker/securitygroup.go index 5dba9c5..3cb7345 100644 --- a/pkg/cloudbroker/securitygroup.go +++ b/pkg/cloudbroker/securitygroup.go @@ -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) } diff --git a/pkg/cloudbroker/storage_policy.go b/pkg/cloudbroker/storage_policy.go new file mode 100644 index 0000000..9e0e1c7 --- /dev/null +++ b/pkg/cloudbroker/storage_policy.go @@ -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) +} diff --git a/pkg/cloudbroker/storage_policy/models.go b/pkg/cloudbroker/storage_policy/models.go deleted file mode 100644 index 8643881..0000000 --- a/pkg/cloudbroker/storage_policy/models.go +++ /dev/null @@ -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"` -} diff --git a/pkg/cloudbroker/storagepolicy.go b/pkg/cloudbroker/storagepolicy.go deleted file mode 100644 index 732eb08..0000000 --- a/pkg/cloudbroker/storagepolicy.go +++ /dev/null @@ -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) -} diff --git a/pkg/cloudbroker/storage_policy/add_pool.go b/pkg/cloudbroker/stpolicy/add_pool.go similarity index 76% rename from pkg/cloudbroker/storage_policy/add_pool.go rename to pkg/cloudbroker/stpolicy/add_pool.go index a957e4f..f01e898 100644 --- a/pkg/cloudbroker/storage_policy/add_pool.go +++ b/pkg/cloudbroker/stpolicy/add_pool.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/create.go b/pkg/cloudbroker/stpolicy/create.go similarity index 80% rename from pkg/cloudbroker/storage_policy/create.go rename to pkg/cloudbroker/stpolicy/create.go index b3a4181..2068ceb 100644 --- a/pkg/cloudbroker/storage_policy/create.go +++ b/pkg/cloudbroker/stpolicy/create.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/delete.go b/pkg/cloudbroker/stpolicy/delete.go similarity index 86% rename from pkg/cloudbroker/storage_policy/delete.go rename to pkg/cloudbroker/stpolicy/delete.go index 38e4889..a6aa9da 100644 --- a/pkg/cloudbroker/storage_policy/delete.go +++ b/pkg/cloudbroker/stpolicy/delete.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/delete_pool.go b/pkg/cloudbroker/stpolicy/delete_pool.go similarity index 73% rename from pkg/cloudbroker/storage_policy/delete_pool.go rename to pkg/cloudbroker/stpolicy/delete_pool.go index 76d124a..a4d8217 100644 --- a/pkg/cloudbroker/storage_policy/delete_pool.go +++ b/pkg/cloudbroker/stpolicy/delete_pool.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/disable.go b/pkg/cloudbroker/stpolicy/disable.go similarity index 86% rename from pkg/cloudbroker/storage_policy/disable.go rename to pkg/cloudbroker/stpolicy/disable.go index c6be2fa..bbcc99e 100644 --- a/pkg/cloudbroker/storage_policy/disable.go +++ b/pkg/cloudbroker/stpolicy/disable.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/enable.go b/pkg/cloudbroker/stpolicy/enable.go similarity index 86% rename from pkg/cloudbroker/storage_policy/enable.go rename to pkg/cloudbroker/stpolicy/enable.go index b889e69..33e7764 100644 --- a/pkg/cloudbroker/storage_policy/enable.go +++ b/pkg/cloudbroker/stpolicy/enable.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/filter.go b/pkg/cloudbroker/stpolicy/filter.go similarity index 98% rename from pkg/cloudbroker/storage_policy/filter.go rename to pkg/cloudbroker/stpolicy/filter.go index 2e053c1..25599e2 100644 --- a/pkg/cloudbroker/storage_policy/filter.go +++ b/pkg/cloudbroker/stpolicy/filter.go @@ -1,4 +1,4 @@ -package storagepolicy +package stpolicy // FilterByID returns ListStoragePolicies with specified ID. func (lsp ListStoragePolicies) FilterByID(id uint64) ListStoragePolicies { diff --git a/pkg/cloudbroker/storage_policy/filter_test.go b/pkg/cloudbroker/stpolicy/filter_test.go similarity index 87% rename from pkg/cloudbroker/storage_policy/filter_test.go rename to pkg/cloudbroker/stpolicy/filter_test.go index 2666c10..4eacea4 100644 --- a/pkg/cloudbroker/storage_policy/filter_test.go +++ b/pkg/cloudbroker/stpolicy/filter_test.go @@ -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{}, diff --git a/pkg/cloudbroker/storage_policy/get.go b/pkg/cloudbroker/stpolicy/get.go similarity index 78% rename from pkg/cloudbroker/storage_policy/get.go rename to pkg/cloudbroker/stpolicy/get.go index 31ebd3c..2a0bafc 100644 --- a/pkg/cloudbroker/storage_policy/get.go +++ b/pkg/cloudbroker/stpolicy/get.go @@ -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)) diff --git a/pkg/cloudbroker/storage_policy/list.go b/pkg/cloudbroker/stpolicy/list.go similarity index 91% rename from pkg/cloudbroker/storage_policy/list.go rename to pkg/cloudbroker/stpolicy/list.go index 8827ff5..0ced471 100644 --- a/pkg/cloudbroker/storage_policy/list.go +++ b/pkg/cloudbroker/stpolicy/list.go @@ -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)) diff --git a/pkg/cloudbroker/stpolicy/models.go b/pkg/cloudbroker/stpolicy/models.go new file mode 100644 index 0000000..e298fc6 --- /dev/null +++ b/pkg/cloudbroker/stpolicy/models.go @@ -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"` +} diff --git a/pkg/cloudbroker/storage_policy/storage_policy.go b/pkg/cloudbroker/stpolicy/storage_policy.go similarity index 61% rename from pkg/cloudbroker/storage_policy/storage_policy.go rename to pkg/cloudbroker/stpolicy/storage_policy.go index 42b42a2..6b6d61f 100644 --- a/pkg/cloudbroker/storage_policy/storage_policy.go +++ b/pkg/cloudbroker/stpolicy/storage_policy.go @@ -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, } } diff --git a/pkg/cloudbroker/storage_policy/update.go b/pkg/cloudbroker/stpolicy/update.go similarity index 84% rename from pkg/cloudbroker/storage_policy/update.go rename to pkg/cloudbroker/stpolicy/update.go index d233c76..7494a77 100644 --- a/pkg/cloudbroker/storage_policy/update.go +++ b/pkg/cloudbroker/stpolicy/update.go @@ -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)) diff --git a/tests/platform_upgrade/cloud_test.go b/tests/platform_upgrade/cloud_test.go index ef6a63c..afcc6e0 100644 --- a/tests/platform_upgrade/cloud_test.go +++ b/tests/platform_upgrade/cloud_test.go @@ -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") } diff --git a/tests/platform_upgrade/request_map.go b/tests/platform_upgrade/request_map.go index f6af4cc..9e86e1b 100644 --- a/tests/platform_upgrade/request_map.go +++ b/tests/platform_upgrade/request_map.go @@ -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{}, diff --git a/tests/platform_upgrade/utils_urls.go b/tests/platform_upgrade/utils_urls.go index 90dd6d7..4353bec 100644 --- a/tests/platform_upgrade/utils_urls.go +++ b/tests/platform_upgrade/utils_urls.go @@ -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