Compare commits

...
5 Commits
Author SHA1 Message Date
dayterr 70edc100d5 v16.7.0
v16.7.0
2026-10-09 16:28:36 +03:00
dayterr 025a1274f4 v16.6.0
v16.6.0
2026-10-02 16:42:23 +03:00
aafetisov dca445b69a v16.5.0 2026-09-28 13:41:59 +03:00
dayterr 2c7f0d29df v16.4.0
v16.4.0
2026-09-18 16:56:47 +03:00
dayterr 4c05d94552 v16.3.0
v16.3.0
2026-09-15 17:42:23 +03:00
265 changed files with 6172 additions and 805 deletions

No files matched your search

+238 -21
View File
@@ -1,15 +1,23 @@
## Version 16.2.0
## Version 16.7.0
### Deprecated
Перечисленные методы будут удалены в `v17`
Перечисленные методы будут удалены в `v17.0.0`
| Метод | CloudAPI | CloudBroker |
| --- | --- | --- |
| `account/AddUser` | :heavy_check_mark: | :heavy_check_mark: |
| `account/DeleteUser` | :heavy_check_mark: | :heavy_check_mark: |
| `account/UpdateUser` | :heavy_check_mark: | :heavy_check_mark: |
| `compute/DiskQOS` | :heavy_check_mark: | :heavy_check_mark: |
| `compute/Migrate` | :x: | :heavy_check_mark: |
| `compute/MigrateAbort` | :x: | :heavy_check_mark: |
| `compute/MigrateStorage` | :x: | :heavy_check_mark: |
| `compute/MigrateStorageAbort` | :x: | :heavy_check_mark: |
| `compute/MigrateStorageCleanUp` | :x: | :heavy_check_mark: |
| `compute/MigrateStorageInfo` | :x: | :heavy_check_mark: |
| `compute/MigrateStorageList` | :x: | :heavy_check_mark: |
| `compute/UserGrant` | :heavy_check_mark: | :heavy_check_mark: |
| `compute/UserList` | :heavy_check_mark: | :heavy_check_mark: |
| `compute/UserRevoke` | :heavy_check_mark: | :heavy_check_mark: |
@@ -17,44 +25,253 @@
| `rg/AccessGrant` | :heavy_check_mark: | :heavy_check_mark: |
| `rg/AccessRevoke` | :heavy_check_mark: | :heavy_check_mark: |
| `sep/ConfigFieldEdit` | :x: | :heavy_check_mark: |
| `apiaccess/userList` | :x: | :heavy_check_mark: |
### Добавлено
#### audit
#### compute
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1025 | Вычисляемое поле `PublicSessionID` в структуры ответа `ItemAudit` и `RecordAudit` в cloudbroker/audit и cloudapi/audit |
| BGOS-1025 | Опциональное поле `PublicSessionID` в структуру запроса `ListRequest` в cloudbroker/audit и cloudapi/audit |
| BGOS-1111 | Опциональное поле `Planned` в структуру запроса `DiskSwitchToReplicationRequest` в cloudapi/compute |
| BGOS-1111 | Опциональное поле `Planned` в структуру запроса `DiskSwitchToReplicationRequest` в cloudbroker/compute |
| BGOS-1118 | Вычисляемое поле `CRTTracking` в структуру ответа `ItemComputeDisk` в cloudapi/compute |
| BGOS-1118 | Вычисляемое поле `CRTTracking` в структуру ответа `ItemDisk` в cloudbroker/compute |
| BGOS-1120 | Структура запроса `wrapperMigrateStorageRequest` и метод `MigrateStorageAsync` в cloudbroker/compute |
#### grid
#### disks
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1028 | Вычисляемое поле `Budget` в структуры ответа `ItemGridList` и `RecordGrid` в cloudbroker/grid |
| BGOS-1109 | Структура запроса `ReplicationManualSyncRequest` и метод `ReplicationManualSync` в cloudapi/disks |
| BGOS-1109 | Структура запроса `ReplicationSetScheduleRequest` и метод `ReplicationSetSchedule` в cloudapi/disks |
| BGOS-1109 | Структура запроса `ReplicationDisableScheduleRequest` и метод `ReplicationDisableSchedule` в cloudapi/disks |
| BGOS-1109 | Структура запроса `ReplicationSetCopyRateRequest` и метод `ReplicationSetCopyRate` в cloudapi/disks |
| BGOS-1109 | Структура запроса `ReplicationPromote` и методы `ReplicationPromote` и `ReplicationPromoteAsync` в cloudapi/disks |
| BGOS-1109 | Структура запроса `ReplicationSyncNowRequest` и метод `ReplicationSyncNow` в cloudbroker/disks |
| BGOS-1109 | Структура запроса `ReplicationEnableScheduleRequest` и метод `ReplicationEnableSchedule` в cloudbroker/disks |
| BGOS-1109 | Структура запроса `ReplicationDisableScheduleRequest` и метод `ReplicationDisableSchedule` в cloudbroker/disks |
| BGOS-1109 | Структура запроса `ReplicationSetCopyRateRequest` и метод `ReplicationSetCopyRate` в cloudbroker/disks |
| BGOS-1109 | Структура запроса `ReplicationPromote` и методы `ReplicationPromote` и `ReplicationPromoteAsync` в cloudbroker/disks |
| BGOS-1108 | Вычисляемое поле `CRTTracking` в структуру ответа `InfoDisk` в cloudbroker/disks |
| BGOS-1108 | Вычисляемое поле `CRTTracking` в структуры ответа `ItemDisk`, `ItemDiskUnattached` и `RecordDisk` в cloudapi/disks |
| BGOS-1110 | Опциональные поля `CopyRate` и `Schedule` в структуры запроса `ReplicateRequest` и `ReplicationStartRequest` в cloudbroker/disks |
| BGOS-1110 | Опциональное поле `Planned` в структуру запроса `ReplicationReverseRequest` в cloudbroker/disks |
| BGOS-1110 | Опциональные поля `CopyRate` и `Schedule` в структуры запроса `ReplicateRequest` и `ReplicationStartRequest` в cloudapi/disks |
| BGOS-1110 | Опциональное поле `Planned` в структуру запроса `ReplicationReverseRequest` в cloudapi/disks |
| BGOS-1113 | Опциональное поле `KeepCurrentIOTune` в структуру запроса `ChangeDiskStoragePolicyRequest` в cloudbroker/disks |
| BGOS-1113 | Опциональное поле `KeepCurrentIOTune` в структуру запроса `ChangeDiskStoragePolicyRequest` в cloudapi/disks |
| BGOS-1114 | Опциональные поля `TotalBytesSecMaxLength`, `ReadBytesSecMaxLength`, `WriteBytesSecMaxLength`, `TotalIOPSSecMaxLength`, `ReadIOPSSecMaxLength` и `WriteIOPSSecMaxLength` в структуру запроса `LimitIORequest` в cloudbroker/disks |
| BGOS-1114 | Опциональные поля `TotalBytesSecMaxLength`, `ReadBytesSecMaxLength`, `WriteBytesSecMaxLength`, `TotalIOPSSecMaxLength`, `ReadIOPSSecMaxLength` и `WriteIOPSSecMaxLength` в структуру запроса `LimitIORequest` в cloudapi/disks |
#### vins
#### dpdknet
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1027 | Вычисляемое поле `QoSPolicies` в структуру ответа `ItemVNFInterface` в cloudbroker/vins и cloudapi/vins |
| BGOS-1116 | Опциональные поля `AccountAccess` и `RGAccess` в структуру запроса `ListRequest` в cloudapi/dpdknet |
#### session
#### pcidevice
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1026 | Группа ручек cloudbroker/session |
| BGOS-1115 | Опциональное поле `NodeID` в структуру запроса `ListRequest` в cloudbroker/pcidevice |
| BGOS-1115 | Опциональное поле `NodeID` в структуру запроса `ListRequest` в cloudapi/pcidevice |
#### SDN defsecpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1103 | Вычисляемое поле `AccessGroupName` в структуру ответа `SecurityPolicy` в sdn/defsecpolicies |
| BGOS-1103 | Вычисляемые поля `AppliedNetObjectGroups`, `DestinationNetObjectGroups`, `LoggingProfile`, `LoggingProfileID`, `SecurityRuleConditionGroups`, `SecurityRuleConditions`, `SourceNetObjectGroups` и `Type` в структуру ответа `SecurityRule` в sdn/defsecpolicies |
| BGOS-1103 | Вычисляемые поля `EthType`, `IPProto`, `TCPSrcPorts` и `UDPSrcPorts` в структуру ответа `FilterParams` в sdn/defsecpolicies |
| BGOS-1103 | Структуры ответа `AppliedNetObjectGroup`, `NetObjectGroup`, `LoggingProfile`, `SecurityRuleConditionGroup` и `SecurityRuleCondition` в sdn/defsecpolicies |
#### SDN extnet
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1105 | Вычисляемые поля `OperationStatus` и `HypervisorStatus` в структуру ответа `Status` в sdn/extnet |
| BGOS-1105 | Вычисляемое поле `OperationStatus` в структуру ответа `HypervisorStatus` в sdn/extnet |
| BGOS-1105 | Вычисляемые поля `ExternalNetworkID`, `ID` и `VersionID` в структуру ответа `ExternalNetworkPort` в sdn/extnet |
| BGOS-1105 | Вычисляемые поля `CreatedBy` и `UpdatedBy` в структуру ответа `FloatingIP` в sdn/extnet |
| BGOS-1105 | Вычисляемые поля `ExcludeFirewall` и `Labels` в структуру ответа `LogicalPort` в sdn/extnet |
| BGOS-1105 | Вычисляемые поля `L2ConnectionPort` и `Type` в структуру ответа `Segment` в sdn/extnet |
| BGOS-1105 | Обязательное поле `OperationStatus` в структуру запроса `StatusRequest` в sdn/extnet |
| BGOS-1105 | Обязательное поле `OperationStatus` в структуру запроса `HypervisorStatusRequest` в sdn/extnet |
| BGOS-1105 | Опциональные поля `CreatedBy` и `UpdatedBy` в структуру запроса `FloatingIPRequest` в sdn/extnet |
| BGOS-1105 | Обязательные поля `DisplayName` и `ExcludeFirewall` в структуру запроса `LogicalPortRequest` в sdn/extnet |
| BGOS-1105 | Опциональное поле `Labels` в структуру запроса `LogicalPortRequest` в sdn/extnet |
| BGOS-1105 | Обязательные поля `IPv4Address` и `IPv6Address` в структуру запроса `RouterPortRequest` в sdn/extnet |
| BGOS-1105 | Обязательное поле `Type` в структуру запроса `SegmentRequest` в sdn/extnet |
| BGOS-1105 | Опциональное поле `L2ConnectionPort` в структуру запроса `SegmentRequest` в sdn/extnet |
#### SDN routers
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1106 | Вычисляемое поле `OperationStatus` в структуру ответа `Status` в sdn/routers |
| BGOS-1106 | Вычисляемое поле `OperationStatus` в структуру ответа `Status` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемое поле `OperationStatus` в структуру ответа `HypervisorStatus` в sdn/routers |
| BGOS-1106 | Вычисляемое поле `OperationStatus` в структуру ответа `HypervisorStatus` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемые поля `ExternalNetworkID`, `ID` и `VersionID` в структуру ответа `ExternalNetworkPort` в sdn/routers |
| BGOS-1106 | Вычисляемые поля `ExternalNetworkID`, `ID` и `VersionID` в структуру ответа `ExternalNetworkPort` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемые поля `CreatedBy` и `UpdatedBy` в структуру ответа `FloatingIP` в sdn/routers |
| BGOS-1106 | Вычисляемые поля `CreatedBy` и `UpdatedBy` в структуру ответа `FloatingIP` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемые поля `ExcludeFirewall` и `Labels` в структуру ответа `LogicalPort` в sdn/routers |
| BGOS-1106 | Вычисляемые поля `ExcludeFirewall` и `Labels` в структуру ответа `LogicalPort` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемые поля `L2ConnectionPort` и `Type` в структуру ответа `Segment` в sdn/routers |
| BGOS-1106 | Вычисляемые поля `L2ConnectionPort` и `Type` в структуру ответа `Segment` в sdn/routers/gwport |
| BGOS-1106 | Структуры ответа `ExcludeFirewall`, `Labels`, `L2ConnectionPort` и `L2ExternalNetwork` в sdn/routers |
| BGOS-1106 | Структуры ответа `ExcludeFirewall`, `Labels`, `L2ConnectionPort`, `L2ExternalNetwork` и `Router` в sdn/routers/gwport |
| BGOS-1106 | Опциональное поле `OperationStatus` в структуру запроса `ListRequest` в sdn/routers |
#### SDN secpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1104 | Вычисляемые поля `Type`, `EndDateTime`, `LockedAt`, `ScheduleCron` и `StartDateTime` в структуру ответа `SecurityPolicySummary` в sdn/secpolicies |
| BGOS-1104 | Структура ответа `AppliedNetObjectGroup` в sdn/secpolicies |
| BGOS-1104 | Вычисляемые поля `OperationStatus` и `HypervisorStatus` в структуру ответа `Status` в sdn/secpolicies |
| BGOS-1104 | Опциональное поле `SecurityRulesForCreate` в структуру запроса `CreateRequest` в sdn/secpolicies |
| BGOS-1104 | Структуры запроса `AppliedToNetObjectGroup`, `SecurityRuleForCreate`, `RuleNetObjectGroup` и `RuleFilter` в sdn/secpolicies |
| BGOS-1104 | Опциональные поля `OperationStatus` и `Type` в структуру запроса `ListRequest` в sdn/secpolicies |
| BGOS-1104 | Обязательное поле `AccessGroupID` в структуру запроса `UpdateRequest` в sdn/secpolicies |
#### vgpu
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1066 | Обязательное поле `Name` в структуру запроса `CreateRequest` в cloudbroker/vgpu |
| BGOS-1066 | Опциональное поле `Name` в структуру запроса `ListRequest` в cloudbroker/vgpu |
| BGOS-1066 | Вычисляемые поля `Name` и `NodeID` в структуру ответа `ItemVGPU` в cloudbroker/vgpu |
| BGOS-1066 | Опциональное поле `Name` в структуру запроса `ListRequest` в cloudapi/vgpu |
| BGOS-1066 | Вычисляемые поля `Name` и `NodeID` в структуру ответа `ItemVGPU` в cloudapi/vgpu |
| BGOS-1066 | Структура запроса `EditRequest` и метод `Edit` в cloudbroker/vgpu |
| BGOS-1066 | Методы `CreateAsync`, `EditAsync` и `DestroyAsync` в cloudbroker/vgpu |
#### user
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1093 | Опциональное поле `APIAccessID` в структуру запроса `ListRequest` в cloudbroker/user |
### Изменено
#### network qos policy
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1030 | Тип вычисляемых полей `PCPTag` и `DSCPValue` с `uint64` на `*uint64` в структуре ответа `Rule` в cloudapi/qospolicy и cloudbroker/qospolicy |
| BGOS-1030 | Тип опциональных полей `Name` и `Description` с `string` на `*string` в структуре запроса `UpdateRequest` в cloudapi/qospolicy и cloudbroker/qospolicy |
### Удалено
#### compute
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1029 | Опциональное поле `Type` из структуры запроса `ListVGPURequest` в cloudbroker/compute и cloudapi/compute |
| BGOS-1120 | Поле `Async` с обязательного на опциональное в структуре запроса `MigrateStorageRequest` в cloudbroker/compute |
| BGOS-1120 | Тэги `url` и `json` поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `asyncWrapperSnapshotEvictDiskRequest` в cloudbroker/compute |
#### SDN defsecpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1103 | JSON-тэг вычисляемого поля `Filter` с `filter` на `filters` и его тип с `Filter` на `[]FilterParams` в структуре ответа `SecurityRule` в sdn/defsecpolicies |
#### SDN extnet
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1105 | Тип опционального поля `VLANTag` со `string` на `uint64` в структуре запроса `CreateRequest` в sdn/extnet |
| BGOS-1105 | Тип опционального поля `VLANTag` со `string` на `uint64` в структуре запроса `ListRequest` в sdn/extnet |
| BGOS-1105 | Тип опционального поля `VLANTag` со `string` на `uint64` в структуре запроса `UpdateRequest` в sdn/extnet |
| BGOS-1105 | Допустимый диапазон опционального поля `VLANTag` с 1–4095 на 1–4094 в структуре запроса `CreateRequest` в sdn/extnet |
| BGOS-1105 | Допустимый диапазон опционального поля `VLANTag` с 1–4095 на 1–4094 в структуре запроса `UpdateRequest` в sdn/extnet |
| BGOS-1105 | Проверка диапазона 1–4094 для опционального поля `VLANTag` в структуре запроса `ListRequest` в sdn/extnet |
| BGOS-1105 | Тип вычисляемого поля `ExternalNetworkPort` со `string` на `*ExternalNetworkPort` в структуре ответа `FloatingIP` в sdn/extnet |
| BGOS-1105 | Тип вычисляемого поля `ExternalNetworkPort` с `interface{}` на `*ExternalNetworkPort` в структуре ответа `GatewayPort` в sdn/extnet |
| BGOS-1105 | Тип обязательного поля `ExternalNetworkPort` со `string` на `*ExternalNetworkPortRequest` в структуре запроса `FloatingIPRequest` в sdn/extnet |
| BGOS-1105 | Тип обязательного поля `ExternalNetworkPort` с `interface{}` на `*ExternalNetworkPortRequest` в структуре запроса `GatewayPortRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `AccessGroupName`, `IPv4`, `IPv6`, `IPv6Config`, `RouterGatewayPort` и `FloatingIP` с опционального на обязательный в структуре запроса `ExternalNetworkPortRequest` в sdn/extnet |
| BGOS-1105 | Тип поля `LogicalPort` с опционального на обязательный в структуре запроса `FloatingIPRequest` в sdn/extnet |
| BGOS-1105 | Тип поля `HypervisorDisplayName` с опционального на обязательный в структуре запроса `LogicalPortRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `LiveMigrationTargetHV`, `Status`, `Bindings` и `UpdatedAt` с обязательного на опциональный в структуре запроса `LogicalPortRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `SegmentDisplayName`, `SegmentID` и `LogicalPortAddresses` с обязательного на опциональный в структуре запроса `PortBindingsRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `MAC` и `AssignedAt` с опционального на обязательный в структуре запроса `LogicalPortAddressRequest` в sdn/extnet |
| BGOS-1105 | Тип поля `IsPrimary` с обязательного на опциональный в структуре запроса `LogicalPortAddressRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `AccessGroupID`, `AccessGroupName`, `CreatedAt`, `Description`, `Enabled`, `GatewayPorts`, `Policies`, `Ports`, `Status`, `UpdatedAt` и `VersionID` с опционального на обязательный в структуре запроса `RouterRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `ExternalL4PortMax`, `ExternalL4PortMin`, `ID` и `Status` с опционального на обязательный в структуре запроса `GatewayPortRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `Enabled` и `ID` с опционального на обязательный в структуре запроса `RouterPolicyRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `ID` и `Status` с опционального на обязательный в структуре запроса `RouterPortRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `Enabled` и `ID` с опционального на обязательный в структуре запроса `SegmentRequest` в sdn/extnet |
| BGOS-1105 | Тип полей `LeaseTime` и `ServerMAC` с обязательного на опциональный в структуре запроса `DHCPv6ConfigRequest` в sdn/extnet |
| BGOS-1105 | Тип поля `ID` с опционального на обязательный в структуре запроса `EntityInfoRequest` в sdn/extnet |
#### SDN routers
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1106 | Тип вычисляемого поля `ExternalNetworkPort` со `string` на `*ExternalNetworkPort` в структуре ответа `FloatingIP` в sdn/routers |
| BGOS-1106 | Тип вычисляемого поля `ExternalNetworkPort` со `string` на `*ExternalNetworkPort` в структуре ответа `FloatingIP` в sdn/routers/gwport |
| BGOS-1106 | Тип вычисляемого поля `Router` со `string` на `*RoutersModel` в структуре ответа `FloatingIP` в sdn/routers |
| BGOS-1106 | Тип вычисляемого поля `Router` со `string` на `*Router` в структуре ответа `FloatingIP` в sdn/routers/gwport |
#### SDN secpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1104 | Вычисляемое поле `AppliedToNetObjectGroupID` переименовано в `AppliedNetObjectGroups` в структуре ответа `SecurityPolicySummary` в sdn/secpolicies |
| BGOS-1104 | Тип вычисляемого поля `AppliedNetObjectGroups` со `string` на `[]AppliedNetObjectGroup` в структуре ответа `SecurityPolicySummary` в sdn/secpolicies |
| BGOS-1104 | JSON-тэг вычисляемого поля `AppliedNetObjectGroups` с `applied_to_net_object_group_id` на `applied_net_object_groups` в структуре ответа `SecurityPolicySummary` в sdn/secpolicies |
| BGOS-1104 | Вычисляемое поле `Status` переименовано в `OperationStatus` в структуре ответа `HypervisorStatus` в sdn/secpolicies |
| BGOS-1104 | JSON-тэг вычисляемого поля `OperationStatus` с `status` на `operation_status` в структуре ответа `HypervisorStatus` в sdn/secpolicies |
| BGOS-1104 | Тип поля `AppliedToNetObjectGroupID` со `string` на `[]AppliedToNetObjectGroup` в структуре запроса `CreateRequest` в sdn/secpolicies |
| BGOS-1104 | Тэги `url` и `json` поля `AppliedToNetObjectGroupID` с `applied_to_net_object_group_id` на `applied_to_net_object_group_ids` в структуре запроса `CreateRequest` в sdn/secpolicies |
| BGOS-1104 | Тип поля `AppliedToNetObjectGroupID` с обязательного на опциональный в структуре запроса `CreateRequest` в sdn/secpolicies |
| BGOS-1104 | Тип опционального поля `AppliedToNetObjectGroupID` со `string` на `[]string` в структуре запроса `ListRequest` в sdn/secpolicies |
| BGOS-1104 | Тэги `url` и `json` опционального поля `AppliedToNetObjectGroupID` с `applied_to_net_object_group_id` на `applied_to_net_object_group_ids` в структуре запроса `ListRequest` в sdn/secpolicies |
| BGOS-1104 | Поле `AppliedToNetObjectGroupID` переименовано в `AppliedNetObjectGroups` в структуре запроса `UpdateRequest` в sdn/secpolicies |
| BGOS-1104 | Тип поля `AppliedNetObjectGroups` со `string` на `[]AppliedToNetObjectGroup` в структуре запроса `UpdateRequest` в sdn/secpolicies |
| BGOS-1104 | Тэги `url` и `json` поля `AppliedNetObjectGroups` с `applied_to_net_object_group_id` на `applied_net_object_groups` в структуре запроса `UpdateRequest` в sdn/secpolicies |
| BGOS-1104 | Тип поля `AppliedNetObjectGroups` с обязательного на опциональный в структуре запроса `UpdateRequest` в sdn/secpolicies |
| BGOS-1104 | Тип полей `Description` и `DisplayName` с опционального на обязательный в структуре запроса `CreateRequest` в sdn/secpolicies |
| BGOS-1104 | Тип полей `Description` и `DisplayName` с опционального на обязательный в структуре запроса `UpdateRequest` в sdn/secpolicies |
#### sep
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1121 | Тэги `url` и `json` поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `wrapperAddPoolRequest` в cloudbroker/sep |
#### vins
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1119 | Тэги `url` и `json` поля `AsyncMode` с `asyncMode` на `async_mode` в структурах запроса `asyncWrapperCreateInAccountRequest`, `asyncWrapperEnableRequest`, `asyncWrapperCreateInRgRequest`, `asyncWrapperVNFDevRedeployRequest` и `asyncWrapperVNFDevRestartRequest` в cloudapi/vins |
| BGOS-1119 | Тэги `url` и `json` `AsyncMode` с `asyncMode` на `async_mode` в структурах запроса `asyncWrapperCreateInAccountRequest`, `asyncWrapperCreateInRgRequest`, `asyncWrapperEnableRequest`, `asyncWrapperVNFDevRedeployRequest`, `asyncWrapperVNFDevRestartRequest` и `asyncWrapperVNFDevStartRequest` в cloudbroker/vins |
### Исправлено
#### SDN secpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1104 | URL метода `Get` с `/sdn/security_policies/get` на `/sdn/security_policy/get` в sdn/secpolicies |
| BGOS-1104 | Тип поля `InsertUp` с обязательного на опциональный в структуре запроса `MoveRequest` в sdn/secpolicies |
### Удалено
#### SDN defsecpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1103 | Вычисляемые поля `Description`, `LockedAt` и `Status` из структуры ответа `SecurityPolicy` в sdn/defsecpolicies |
| BGOS-1103 | Вычисляемые поля `Description`, `DestinationNetObject`, `LogName`, `LogSeverity`, `SecurityPolicyID` и `SourceNetObject` из структуры ответа `SecurityRule` в sdn/defsecpolicies |
| BGOS-1103 | Вычисляемое поле `DHCP` из структуры ответа `FilterParams` в sdn/defsecpolicies |
| BGOS-1103 | Структуры ответа `Filter`, `NetObject`, `Status` и `HypervisorStatus` в sdn/defsecpolicies |
#### SDN extnet
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1105 | Вычисляемое поле `Common` из структуры ответа `Status` в sdn/extnet |
| BGOS-1105 | Вычисляемое поле `Status` из структуры ответа `HypervisorStatus` в sdn/extnet |
| BGOS-1105 | Вычисляемое поле `IsExcludedFromFirewall` из структуры ответа `PortBindings` в sdn/extnet |
| BGOS-1105 | Обязательное поле `Common` из структуры запроса `StatusRequest` в sdn/extnet |
| BGOS-1105 | Обязательное поле `Status` из структуры запроса `HypervisorStatusRequest` в sdn/extnet |
| BGOS-1105 | Обязательное поле `RouterDisplayName` из структуры запроса `LogicalPortRequest` в sdn/extnet |
| BGOS-1105 | Обязательное поле `IsExcludedFromFirewall` из структуры запроса `PortBindingsRequest` в sdn/extnet |
| BGOS-1105 | Обязательные поля `NextIPv4Address` и `NextIPv6Address` из структуры запроса `RouterPortRequest` в sdn/extnet |
#### SDN routers
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1106 | Вычисляемое поле `Common` из структуры ответа `Status` в sdn/routers |
| BGOS-1106 | Вычисляемое поле `Common` из структуры ответа `Status` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемое поле `Status` из структуры ответа `HypervisorStatus` в sdn/routers |
| BGOS-1106 | Вычисляемое поле `Status` из структуры ответа `HypervisorStatus` в sdn/routers/gwport |
| BGOS-1106 | Вычисляемое поле `IsExcludedFromFirewall` из структуры ответа `Bindings` в sdn/routers |
| BGOS-1106 | Вычисляемое поле `IsExcludedFromFirewall` из структуры ответа `Bindings` в sdn/routers/gwport |
#### SDN secpolicies
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1104 | Вычисляемое поле `SecurityRules` из структуры ответа `SecurityPolicySummary` в sdn/secpolicies |
| BGOS-1104 | Структуры ответа `SecurityRule` и `Filter` в sdn/secpolicies |
| BGOS-1104 | Вычисляемое поле `Common` из структуры ответа `Status` в sdn/secpolicies |
| BGOS-1104 | Опциональное поле `InsertUp` из структуры запроса `UpdateRequest` в sdn/secpolicies |
+5 -1
View File
@@ -126,6 +126,7 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v16
- `Trunk` - получение информации о транковых портах;
- `VFPool` - управление пулом виртуальных сетевых функций;
- `VINS` - управление виртуальными изолированными сетями;
- `VMFolder` – управление директориями ВМ;
- `VGPU` - управление виртуальными графическими процессорами;
- `Zone` - управление зонами.
@@ -166,7 +167,8 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v16
- `User` - управление пользователями (индивидуально);
- `VGPU` - управление виртуальными графическими процессорами;
- `VFPool` - управление пулом виртуальных сетевых функций;
- `VINS` - управление виртуальными изолированными сетями.
- `VINS` - управление виртуальными изолированными сетями;
- `VMFolder` – управление директориями ВМ;
- `Zone` - управление зонами.
### SDN
@@ -342,6 +344,7 @@ func main() {
- `pkg/cloudapi/trunk` - для `Trunk`
- `pkg/cloudapi/vfpool` - для `VFPool`
- `pkg/cloudapi/vins` - для `VINS`
- `pkg/cloudapi/vmfolder` - для `VMFolder`
- `pkg/cloudapi/vgpu` - для `VGPU`
- `pkg/cloudapi/zone` - для `Zone`
- **cloudbroker**:
@@ -378,6 +381,7 @@ func main() {
- `pkg/cloudbroker/vgpu` - для `VGPU`
- `pkg/cloudbroker/vfpool` - для `VFPool`
- `pkg/cloudbroker/vins` - для `VINS`
- `pkg/cloudbroker/vmfolder` - для `VMFolder`
- `pkg/cloudbroker/zone` - для `Zone`
- **sdn**:
- `pkg/sdn/acsgroups` - для `Access groups`
+1 -1
View File
@@ -16,7 +16,7 @@ type ListVINSRequest struct {
// Find by VINS ID
// Required: false
VINSID uint64 `url:"vins,omitempty" json:"vinsId,omitempty"`
VINSID uint64 `url:"vinsId,omitempty" json:"vinsId,omitempty"`
// Find by name
// Required: false
+9 -1
View File
@@ -63,6 +63,14 @@ type ListRequest struct {
// Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
// Find by disk id
// Required: false
DiskID uint64 `url:"disk_id,omitempty" json:"disk_id,omitempty"`
// Find by vm folder id
// Required: false
VMFolderID uint64 `url:"vmfolder_id,omitempty" json:"vmfolder_id,omitempty"`
// Find by vins id
// Required: false
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"`
@@ -92,7 +100,7 @@ type ListRequest struct {
ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
// Public Session ID
PublicSessionID string `json:"public_session_id"`
PublicSessionID string `url:"public_session_id,omitempty" json:"public_session_id,omitempty"`
}
// List gets audit records for the specified account object
+36
View File
@@ -88,6 +88,42 @@ type ItemAudit struct {
// TTL
TTL string `json:"_ttl"`
// Resource group ID
ResgroupID uint64 `json:"resgroup_id"`
// Account ID
AccountID uint64 `json:"account_id"`
// Compute ID
ComputeID uint64 `json:"compute_id"`
// VINS ID
VINSID uint64 `json:"vins_id"`
// Service ID
ServiceID uint64 `json:"service_id"`
// K8S ID
K8SID uint64 `json:"k8s_id"`
// FLIPGroup ID
FLIPGroupID uint64 `json:"flipgroup_id"`
// Load balancer ID
LBID uint64 `json:"lb_id"`
// SEP ID
SEPID uint64 `json:"sep_id"`
// Node IDs
NodeIDs []uint64 `json:"node_ids"`
// Persistent disk IDs associated with the operation
DiskIDs []uint64 `json:"disk_ids"`
// API task ID for asynchronous calls
APITask string `json:"apitask"`
}
// List of audits
@@ -20,7 +20,7 @@ type AbortSharedSnapshotMergeRequest struct {
type wrapperAbortSharedSnapshotMergeRequest struct {
AbortSharedSnapshotMergeRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// AbortSharedSnapshotMerge shared snapshots merge abort
+62 -8
View File
@@ -2,9 +2,11 @@ package compute
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
@@ -40,26 +42,78 @@ type AffinityRuleAddRequest struct {
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Migrate compute according to the rule
// Default: false
// Required: false
Migrate bool `url:"migrate" json:"migrate"`
}
type wrapperAffinityRuleAddRequest struct {
AffinityRuleAddRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// AffinityRuleAdd add affinity rule
func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (bool, error) {
func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (AffinityRuleAddResult, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
return AffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/affinityRuleAdd"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
aReq := wrapperAffinityRuleAddRequest{
AffinityRuleAddRequest: req,
AsyncMode: false,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return AffinityRuleAddResult{}, err
}
if !req.Migrate {
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
return AffinityRuleAddResult{Ok: result}, err
}
return result, nil
var report MigrationReport
err = json.Unmarshal(res, &report)
if err != nil {
return AffinityRuleAddResult{}, err
}
return AffinityRuleAddResult{Ok: report.Applied, MigrationReport: &report}, nil
}
// AsyncAffinityRuleAdd add affinity rule in async mode
func (c Compute) AsyncAffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/affinityRuleAdd"
aReq := wrapperAffinityRuleAddRequest{
AffinityRuleAddRequest: req,
AsyncMode: true,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+62 -8
View File
@@ -2,9 +2,11 @@ package compute
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
@@ -40,26 +42,78 @@ type AntiAffinityRuleAddRequest struct {
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Migrate compute according to the rule
// Default: false
// Required: false
Migrate bool `url:"migrate" json:"migrate"`
}
type wrapperAntiAffinityRuleAddRequest struct {
AntiAffinityRuleAddRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// AntiAffinityRuleAdd add anti affinity rule
func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (bool, error) {
func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (AntiAffinityRuleAddResult, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
return AntiAffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/antiAffinityRuleAdd"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
aReq := wrapperAntiAffinityRuleAddRequest{
AntiAffinityRuleAddRequest: req,
AsyncMode: false,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return AntiAffinityRuleAddResult{}, err
}
if !req.Migrate {
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
return AntiAffinityRuleAddResult{Ok: result}, err
}
return result, nil
var report MigrationReport
err = json.Unmarshal(res, &report)
if err != nil {
return AntiAffinityRuleAddResult{}, err
}
return AntiAffinityRuleAddResult{Ok: report.Applied, MigrationReport: &report}, nil
}
// AsyncAntiAffinityRuleAdd add anti affinity rule in async mode
func (c Compute) AsyncAntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/antiAffinityRuleAdd"
aReq := wrapperAntiAffinityRuleAddRequest{
AntiAffinityRuleAddRequest: req,
AsyncMode: true,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+1 -1
View File
@@ -18,7 +18,7 @@ type CDEjectRequest struct {
type wrapperCDEjectRequest struct {
CDEjectRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// CDEject eject CD image to compute's CD-ROM
+1 -1
View File
@@ -22,7 +22,7 @@ type CDInsertRequest struct {
type wrapperCDInsertRequest struct {
CDInsertRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// CDInsert insert new CD image to compute's CD-ROM
+1 -1
View File
@@ -34,7 +34,7 @@ type ChangeIPRequest struct {
type wrapperChangeIPRequest struct {
ChangeIPRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// ChangeIP change reserved IP for compute instance
+1 -1
View File
@@ -27,7 +27,7 @@ type ChangeLinkStateRequest struct {
type wrapperChangeLinkStateRequest struct {
ChangeLinkStateRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// ChangeLinkState changes the status link virtual of compute
+1 -1
View File
@@ -26,7 +26,7 @@ type ChangeMTURequest struct {
type wrapperChangeMTURequest struct {
ChangeMTURequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// ChangeMTU change MTU for compute instance
+1 -1
View File
@@ -26,7 +26,7 @@ type ChangeQoSPoliciesRequest struct {
type wrapperChangeQoSPoliciesRequest struct {
ChangeQoSPoliciesRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// ChangeQoSPolicies change qos policies for compute
@@ -30,7 +30,7 @@ type ChangeSecGroupsRequest struct {
type wrapperChangeSecGroupsRequest struct {
ChangeSecGroupsRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// ChangeSecGroups changes security groups for compute
+1 -1
View File
@@ -47,7 +47,7 @@ type CloneRequest struct {
type wrapperCloneRequest struct {
CloneRequest
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// Clone clones compute instance
+1 -1
View File
@@ -22,7 +22,7 @@ type CreateTemplateRequest struct {
type wrapperCreateTemplateRequest struct {
CreateTemplateRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// CreateTemplate create template from compute instance
@@ -39,10 +39,6 @@ type CreateTemplateFromBlankRequest struct {
// Required: false
Password string `url:"password,omitempty" json:"password,omitempty"`
// Account ID to make the image exclusive
// Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Pool for image create
// Required: false
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
@@ -55,7 +51,7 @@ type CreateTemplateFromBlankRequest struct {
type wrapperCreateTemplateFromBlankRequest struct {
CreateTemplateFromBlankRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// CreateTemplateFromBlank creates template from boot disk of current compute in sync mode.
+1 -1
View File
@@ -26,7 +26,7 @@ type DeleteRequest struct {
type wrapperDeleteRequest struct {
DeleteRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Delete deletes compute
+1 -1
View File
@@ -18,7 +18,7 @@ type DisableRequest struct {
type wrapperDisableRequest struct {
DisableRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Disable disables compute
+1 -1
View File
@@ -60,7 +60,7 @@ type DiskAddRequest struct {
type wrapperDiskAddRequest struct {
DiskAddRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskAdd creates new disk and attach to compute
+1 -1
View File
@@ -34,7 +34,7 @@ type DiskAttachRequest struct {
type wrapperDiskAttachRequest struct {
DiskAttachRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskAttach attach disk to compute
+1 -1
View File
@@ -26,7 +26,7 @@ type DiskDelRequest struct {
type wrapperDiskDelRequest struct {
DiskDelRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskDel delete disk and detach from compute
+1 -1
View File
@@ -22,7 +22,7 @@ type DiskDetachRequest struct {
type wrapperDiskDetachRequest struct {
DiskDetachRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskDetach detach disk from compute
+5 -1
View File
@@ -26,10 +26,12 @@ type DiskQOSRequest struct {
type wrapperDiskQOSRequest struct {
DiskQOSRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskQOS change QoS of the disk
//
// Deprecated: will be removed in SDK v1.17
func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
@@ -57,6 +59,8 @@ func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error)
}
// DiskQOSAsync changes QoS of the disk with AsyncMode
//
// Deprecated: will be removed in SDK v1.17
func (c Compute) DiskQOSAsync(ctx context.Context, req DiskQOSRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
+1 -1
View File
@@ -26,7 +26,7 @@ type DiskResizeRequest struct {
type wrapperDiskResizeRequest struct {
DiskResizeRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskResize change disk size
@@ -20,13 +20,17 @@ type DiskSwitchToReplicationRequest struct {
// Delete replication relationship
// Required: false
StopReplication bool `url:"stopReplication" json:"stopReplication"`
StopReplication bool `url:"stopReplication,omitempty" json:"stopReplication,omitempty"`
// Use planned failover for asynchronous replication
// Required: false
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
}
type wrapperDiskSwitchToReplicationRequest struct {
DiskSwitchToReplicationRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// DiskSwitchToReplication switches disk to it's replication
+1 -1
View File
@@ -18,7 +18,7 @@ type GuestAgentDisableRequest struct {
type wrapperGuestAgentDisableRequest struct {
GuestAgentDisableRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Disable guest agent at a specific compute
+1 -1
View File
@@ -18,7 +18,7 @@ type GuestAgentEnableRequest struct {
type wrapperGuestAgentEnableRequest struct {
GuestAgentEnableRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Enable guest agent at a specific compute
+1 -1
View File
@@ -26,7 +26,7 @@ type GuestAgentExecuteRequest struct {
type wrapperGuestAgentExecuteRequest struct {
GuestAgentExecuteRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Execute guest agent command
@@ -18,7 +18,7 @@ type GuestAgentFeatureUpdateRequest struct {
type wrapperGuestAgentFeatureUpdateRequest struct {
GuestAgentFeatureUpdateRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Feature update guest agent
+8
View File
@@ -63,6 +63,14 @@ type ListRequest struct {
// Required: false
ZoneID uint64 `url:"zone_id,omitempty" json:"zone_id,omitempty"`
// Find by VM folder ID
// Required: false
FolderID uint64 `url:"folder_id,omitempty" json:"folder_id,omitempty"`
// Include computes from descendant folders.
// Required: false
IncludeDescendants interface{} `url:"include_descendants,omitempty" json:"include_descendants,omitempty" validate:"omitempty,isBool"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
+1 -1
View File
@@ -22,7 +22,7 @@ type MigrateToZoneRequest struct {
type wrapperMigrateToZoneRequest struct {
MigrateToZoneRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// MoveToRG moves compute instance to new resource group
+53
View File
@@ -575,6 +575,9 @@ type RecordCompute struct {
// Zone ID
// Required: false
ZoneID uint64 `json:"zoneId"`
// Folder ID
FolderID uint64 `json:"folder_id"`
}
// Detailed information about ACL Access in a compute
@@ -1104,6 +1107,9 @@ type ItemComputeDisk struct {
// Created time
CreatedTime uint64 `json:"createdTime"`
// Whether CRT tracking is enabled
CRTTracking bool `json:"crt_tracking"`
// Device name
DeviceName string `json:"devicename"`
@@ -1564,6 +1570,9 @@ type ItemCompute struct {
// Zone ID
ZoneID uint64 `json:"zoneId"`
// Folder ID
FolderID uint64 `json:"folder_id"`
}
// ListInfoDisks
@@ -1743,3 +1752,47 @@ type CloneStatus struct {
// Progress percent
ProgressPercent int `json:"progress_percent"`
}
type MigrationReportItem struct {
// ID of the compute instance
ComputeID uint64 `json:"compute_id"`
// Per-VM action result, not workflow status
// Should be one of:
// - migrated: migration completed; the rule may still be unsatisfied
// - skipped: migration was not needed or applicable
// - not_started: submission was not attempted
// - not_completed: completion is unconfirmed; the VM may have moved
Status string `json:"status"`
// Action details, errors and final rule-placement warnings
Message string `json:"message"`
// Workflow ID for tracking, or nil if submission was not attempted.
// A non-nil ID does not confirm job acceptance
WorkflowJobID *string `json:"workflow_job_id"`
}
type MigrationReport struct {
// Rules were saved; does not confirm migration success or rule satisfaction
Applied bool `json:"applied"`
// Per-compute migration results
Migrations []MigrationReportItem `json:"migrations"`
}
type AffinityRuleAddResult struct {
// Result of the rule addition
Ok bool
// Migration report. Populated only when the request was made with Migrate=true, nil otherwise
MigrationReport *MigrationReport
}
type AntiAffinityRuleAddResult struct {
// Result of the rule addition
Ok bool
// Migration report. Populated only when the request was made with Migrate=true, nil otherwise
MigrationReport *MigrationReport
}
+1 -1
View File
@@ -37,7 +37,7 @@ type MoveToRGRequest struct {
type wrapperMoveToRGRequest struct {
MoveToRGRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// MoveToRG moves compute instance to new resource group
+1 -1
View File
@@ -96,7 +96,7 @@ type NetAttachRequest struct {
type wrapperNetAttachRequest struct {
NetAttachRequest
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// NetAttach attaches network to compute and gets info about network
+1 -1
View File
@@ -26,7 +26,7 @@ type NetDetachRequest struct {
type wrapperNetDetachRequest struct {
NetDetachRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// NetDetach detaches network from compute
+1 -1
View File
@@ -18,7 +18,7 @@ type PauseRequest struct {
type wrapperPauseRequest struct {
PauseRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Pause pause compute
+1 -1
View File
@@ -36,7 +36,7 @@ type PFWAddRequest struct {
type wrapperPFWAddRequest struct {
PFWAddRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// PFWAdd add port forward rule
+1 -1
View File
@@ -39,7 +39,7 @@ type PFWDelRequest struct {
type wrapperPFWDelRequest struct {
PFWDelRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// PFWDel deletes port forward rule
+1 -1
View File
@@ -23,7 +23,7 @@ type PinToNodeRequest struct {
type wrapperPinToNodeRequest struct {
PinToNodeRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// PinToNode pin compute to current node
+1 -1
View File
@@ -18,7 +18,7 @@ type PowerCycleRequest struct {
type wrapperPowerCycleRequest struct {
PowerCycleRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// PowerCycle makes force stop and start compute
+1 -1
View File
@@ -18,7 +18,7 @@ type RebootRequest struct {
type wrapperRebootRequest struct {
RebootRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Reboot reboots compute
+1 -1
View File
@@ -47,7 +47,7 @@ type RedeployRequest struct {
type wrapperRedeployRequest struct {
RedeployRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Redeploy redeploys compute
+1 -1
View File
@@ -18,7 +18,7 @@ type ResetRequest struct {
type wrapperResetRequest struct {
ResetRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Reset resets compute
+1 -1
View File
@@ -46,7 +46,7 @@ func (r ResizeRequest) GetRAM() map[string]uint64 {
type wrapperResizeRequest struct {
ResizeRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Resize resizes compute instance
+1 -1
View File
@@ -18,7 +18,7 @@ type RestoreRequest struct {
type wrapperRestoreRequest struct {
RestoreRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Restore restores compute from recycle bin
+1 -1
View File
@@ -18,7 +18,7 @@ type ResumeRequest struct {
type wrapperResumeRequest struct {
ResumeRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Resume resume Compute from paused state
+1 -1
View File
@@ -29,7 +29,7 @@ type SnapshotCreateRequest struct {
type wrapperSnapshotCreateRequest struct {
SnapshotCreateRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// SnapshotCreate creates compute snapshot
+1 -1
View File
@@ -21,7 +21,7 @@ type SnapshotDeleteRequest struct {
type wrapperSnapshotDeleteRequeststruct struct {
SnapshotDeleteRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// SnapshotDelete deletes specified compute snapshot
+1 -1
View File
@@ -26,7 +26,7 @@ type SnapshotRollbackRequest struct {
type wrapperSnapshotRollbackRequest struct {
SnapshotRollbackRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// SnapshotRollback rollbacks specified compute snapshot
+1 -1
View File
@@ -22,7 +22,7 @@ type StartRequest struct {
type wrapperStartRequest struct {
StartRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Start starts compute
+1 -1
View File
@@ -22,7 +22,7 @@ type StopRequest struct {
type wrapperStopRequest struct {
StopRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Stop stops compute
+1 -1
View File
@@ -82,7 +82,7 @@ type UpdateRequest struct {
// Memory balloon mode. One of ["auto","legacy","none"]
// Required: false
// Default: "auto"
// Default: none
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
}
@@ -18,6 +18,11 @@ type ChangeDiskStoragePolicyRequest struct {
// ID of the storage policy to which to connect for disk
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Keep current disk I/O tune settings in the domain XML
// Required: false
// Default: false
KeepCurrentIOTune interface{} `url:"keep_current_iot,omitempty" json:"keep_current_iot,omitempty" validate:"omitempty,isBool"`
}
type wrapperChangeDiskStoragePolicyRequest struct {
+1 -5
View File
@@ -35,10 +35,6 @@ type FromPlatformDiskRequest struct {
// Required: false
Password string `url:"password,omitempty" json:"password,omitempty"`
// Account ID to make the image exclusive
// Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Pool for image create
// Required: false
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
@@ -54,7 +50,7 @@ type FromPlatformDiskRequest struct {
type wrapperFromPlatformDiskRequest struct {
FromPlatformDiskRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// FromPlatformDisk creates template from platform disk in sync mode.
+24
View File
@@ -67,6 +67,30 @@ type LimitIORequest struct {
// Required: false
WriteIOPSSecMax uint64 `url:"write_iops_sec_max,omitempty" json:"write_iops_sec_max,omitempty"`
// Duration in seconds of the total bytes burst. Requires TotalBytesSecMax
// Required: false
TotalBytesSecMaxLength uint64 `url:"total_bytes_sec_max_length,omitempty" json:"total_bytes_sec_max_length,omitempty"`
// Duration in seconds of the read bytes burst. Requires ReadBytesSecMax
// Required: false
ReadBytesSecMaxLength uint64 `url:"read_bytes_sec_max_length,omitempty" json:"read_bytes_sec_max_length,omitempty"`
// Duration in seconds of the write bytes burst. Requires WriteBytesSecMax
// Required: false
WriteBytesSecMaxLength uint64 `url:"write_bytes_sec_max_length,omitempty" json:"write_bytes_sec_max_length,omitempty"`
// Duration in seconds of the total IOPS burst. Requires TotalIOPSSecMax
// Required: false
TotalIOPSSecMaxLength uint64 `url:"total_iops_sec_max_length,omitempty" json:"total_iops_sec_max_length,omitempty"`
// Duration in seconds of the read IOPS burst. Requires ReadIOPSSecMax
// Required: false
ReadIOPSSecMaxLength uint64 `url:"read_iops_sec_max_length,omitempty" json:"read_iops_sec_max_length,omitempty"`
// Duration in seconds of the write IOPS burst. Requires WriteIOPSSecMax
// Required: false
WriteIOPSSecMaxLength uint64 `url:"write_iops_sec_max_length,omitempty" json:"write_iops_sec_max_length,omitempty"`
// SizeIOPSSec
// Required: false
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
+9
View File
@@ -154,6 +154,9 @@ type ItemDisk struct {
// Cache mode of disk
Cache string `json:"cache"`
// Whether CRT is tracked
CRTTracking bool `json:"crt_tracking"`
}
type ItemDiskUnattached struct {
@@ -300,6 +303,9 @@ type ItemDiskUnattached struct {
// Virtual machine ID
VMID uint64 `json:"vmid"`
// Whether CRT is tracked
CRTTracking bool `json:"crt_tracking"`
}
// List of disks searched
@@ -549,6 +555,9 @@ type RecordDisk struct {
// Cache mode of disk
Cache string `json:"cache"`
// Whether CRT is tracked
CRTTracking bool `json:"crt_tracking"`
}
type ItemReplication struct {
+8
View File
@@ -30,6 +30,14 @@ type ReplicateRequest struct {
// ID of the storage policy under the disk will be created
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// Copy rate for an asynchronous replication pair (in MB/s)
// Required: false
CopyRate uint64 `url:"copy_rate,omitempty" json:"copy_rate,omitempty"`
// Name of the schedule from the replication profile
// Required: false
Schedule string `url:"schedule,omitempty" json:"schedule,omitempty"`
}
type wrapperReplicateRequest struct {
@@ -0,0 +1,38 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ReplicationDisableScheduleRequest to remove the schedule from an asynchronous replication pair
type ReplicationDisableScheduleRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
}
// ReplicationDisableScheduleRequest removes the schedule from an asynchronous replication pair
func (d Disks) ReplicationDisableSchedule(ctx context.Context, req ReplicationDisableScheduleRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/replication_disable_schedule"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
@@ -0,0 +1,38 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ReplicationManualSyncRequest to start manual synchronization of an asynchronous replication pair
type ReplicationManualSyncRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
}
// ReplicationManualSync starts manual synchronization of an asynchronous replication pair
func (d Disks) ReplicationManualSync(ctx context.Context, req ReplicationManualSyncRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/replication_manual_sync"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
+78
View File
@@ -0,0 +1,78 @@
package disks
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ReplicationPromoteRequest to promote the primary side of an asynchronous replication pair
type ReplicationPromoteRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
}
type wrapperReplicationPromoteRequest struct {
ReplicationPromoteRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// ReplicationPromote promotes the primary side of an asynchronous replication pair
func (d Disks) ReplicationPromote(ctx context.Context, req ReplicationPromoteRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/replication_promote"
aReq := wrapperReplicationPromoteRequest{
ReplicationPromoteRequest: req,
AsyncMode: false,
}
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
// ReplicationPromoteAsync promotes the primary side of an asynchronous replication pair in async mode
func (d Disks) ReplicationPromoteAsync(ctx context.Context, req ReplicationPromoteRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/replication_promote"
aReq := wrapperReplicationPromoteRequest{
ReplicationPromoteRequest: req,
AsyncMode: true,
}
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
}
@@ -14,6 +14,10 @@ type ReplicationReverseRequest struct {
// Id of the disk
// Required: true
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
// Use planned failover for asynchronous replication
// Required: false
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
}
type wrapperReplicationReverseRequest struct {
@@ -0,0 +1,42 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ReplicationSetCopyRateRequest to set the copy rate of an asynchronous replication pair
type ReplicationSetCopyRateRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
// Copy rate in MB/s
// Required: true
CopyRate uint64 `url:"copy_rate" json:"copy_rate" validate:"required"`
}
// ReplicationSetCopyRate sets the copy rate of an asynchronous replication pair
func (d Disks) ReplicationSetCopyRate(ctx context.Context, req ReplicationSetCopyRateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/replication_set_copy_rate"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
@@ -0,0 +1,46 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ReplicationSetScheduleRequest to apply a replication profile schedule to an asynchronous replication pair
type ReplicationSetScheduleRequest struct {
// Disk ID
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
// ID of the replication profile assigned to the pair
// Required: true
ProfileID uint64 `url:"profile_id" json:"profile_id" validate:"required"`
// Name of the interval or calendar schedule from the profile
// Required: true
ScheduleName string `url:"schedule_name" json:"schedule_name" validate:"required"`
}
// ReplicationSetSchedule applies a replication profile schedule to an asynchronous replication pair
func (d Disks) ReplicationSetSchedule(ctx context.Context, req ReplicationSetScheduleRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/disks/replication_set_schedule"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
+8
View File
@@ -18,6 +18,14 @@ type ReplicationStartRequest struct {
// ID of target disk. Secondary disk in replication
// Required: true
TargetDiskID uint64 `url:"targetDiskId" json:"targetDiskId" validate:"required"`
// Copy rate for an asynchronous replication pair (in MB/s)
// Required: false
CopyRate uint64 `url:"copy_rate,omitempty" json:"copy_rate,omitempty"`
// Name of the schedule from the replication profile
// Required: false
Schedule string `url:"schedule,omitempty" json:"schedule,omitempty"`
}
type wrapperReplicationStartRequest struct {
+8
View File
@@ -34,6 +34,14 @@ type ListRequest struct {
// Required: false
ComputeIDs []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
// Find by account access
// Required: false
AccountAccess []uint64 `url:"accountAccess,omitempty" json:"accountAccess,omitempty"`
// Find by resource group access
// Required: false
RGAccess []uint64 `url:"rgAccess,omitempty" json:"rgAccess,omitempty"`
// Sort by one of supported fields, format +|-(field)
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
+9
View File
@@ -93,6 +93,9 @@ type ItemReservation struct {
// Account ID
AccountID uint64 `json:"account_id"`
// Auto assignable
AutoAssignable bool `json:"auto_assignable"`
// ClientType
ClientType string `json:"clientType"`
@@ -127,6 +130,12 @@ type VNFs struct {
}
type Excluded struct {
// Account ID
AccountID uint64 `json:"account_id"`
// Auto assignable
AutoAssignable bool `json:"auto_assignable"`
// ClientType
ClientType string `json:"clientType"`
+1 -1
View File
@@ -77,7 +77,7 @@ type CreateRequest struct {
type asyncWrapperCreateRequest struct {
CreateRequest
AsyncMode bool `url:"asyncMode"`
AsyncMode bool `url:"async_mode"`
}
// Create creates image from a media identified by URL
+10 -2
View File
@@ -230,6 +230,10 @@ type CreateRequest struct {
// Required: false
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
// List of PCI device IDs to attach to this VM
// Required: false
PCIdevices []uint64 `url:"pcidevices,omitempty" json:"pcidevices,omitempty"`
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
@@ -250,8 +254,12 @@ type CreateRequest struct {
// Memory balloon mode. One of ["auto","legacy","none"]
// Required: false
// Default: "auto"
// Default: none
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
// List of vGPU IDs to attach to the VM
// Required: false
VGPUs []uint64 `url:"vgpus,omitempty" json:"vgpus,omitempty"`
}
// GetRAM returns RAM field values
@@ -265,7 +273,7 @@ func (r CreateRequest) GetRAM() map[string]uint64 {
type wrapperCreateRequest struct {
CreateRequest
AsyncMode bool `json:"asyncMode"`
AsyncMode bool `json:"async_mode"`
}
// Create creates KVM x86 VM based on specified OS image
+9 -1
View File
@@ -92,6 +92,10 @@ type CreateBlankRequest struct {
// Required: false
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
// List of PCI device IDs to attach to this VM
// Required: false
PCIdevices []uint64 `url:"pcidevices,omitempty" json:"pcidevices,omitempty"`
// VM type linux, windows or unknown
// Required: false
LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"`
@@ -132,8 +136,12 @@ type CreateBlankRequest struct {
// Memory balloon mode. One of ["auto","legacy","none"]
// Required: false
// Default: "auto"
// Default: none
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
// List of vGPU IDs to attach to the VM
// Required: false
VGPUs []uint64 `url:"vgpus,omitempty" json:"vgpus,omitempty"`
}
// GetRAM returns RAM field values
+3
View File
@@ -43,6 +43,9 @@ type ItemLocation struct {
// Is BRO enabled
BROEnabled bool `json:"bro_enabled"`
// Are VM Folders enabled
VMFoldersEnabled bool `json:"vm_folders_enabled"`
}
// List of locations
+4
View File
@@ -34,6 +34,10 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Sort by node ID
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
@@ -0,0 +1,46 @@
package stpolicy
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetReplicationProfileRequest struct to get replication profile
type GetReplicationProfileRequest struct {
// ID of replication profile
// Required: true
ProfileID uint64 `url:"profile_id" json:"profile_id" validate:"required"`
}
// GetReplicationProfile gets replication profile as an InfoReplicationProfile struct
func (sp StPolicy) GetReplicationProfile(ctx context.Context, req GetReplicationProfileRequest) (*InfoReplicationProfile, error) {
res, err := sp.GetReplicationProfileRaw(ctx, req)
if err != nil {
return nil, err
}
info := InfoReplicationProfile{}
err = json.Unmarshal(res, &info)
if err != nil {
return nil, err
}
return &info, nil
}
// GetReplicationProfileRaw gets replication profile as an array of bytes
func (sp StPolicy) GetReplicationProfileRaw(ctx context.Context, req GetReplicationProfileRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/storage_policy/get_replication_profile"
res, err := sp.client.DecortApiCall(ctx, http.MethodGet, url, req)
return res, err
}
@@ -0,0 +1,65 @@
package stpolicy
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ListReplicationProfileRequest struct to get list of replication profiles
type ListReplicationProfileRequest struct {
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
// Search by replication profile ID
// Required: false
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
// Search by replication profile name
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
// Search by replication type
// Required: false
ReplicationType string `url:"replication_type,omitempty" json:"replication_type,omitempty"`
// Sort by one of supported fields, format ±<field>
// Required: false
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty"`
}
// ListReplicationProfile gets list of replication profiles as a ListReplicationProfiles struct
func (sp StPolicy) ListReplicationProfile(ctx context.Context, req ListReplicationProfileRequest) (*ListReplicationProfiles, error) {
res, err := sp.ListReplicationProfileRaw(ctx, req)
if err != nil {
return nil, err
}
list := ListReplicationProfiles{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}
// ListReplicationProfileRaw gets list of replication profiles as an array of bytes
func (sp StPolicy) ListReplicationProfileRaw(ctx context.Context, req ListReplicationProfileRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/storage_policy/list_replication_profile"
res, err := sp.client.DecortApiCall(ctx, http.MethodGet, url, req)
return res, err
}
+77 -2
View File
@@ -27,9 +27,12 @@ type ItemStoragePolicy struct {
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the sotrage policy
// Max IOPS for the storage policy
LimitIOPS uint64 `json:"limit_iops"`
// ID of the replication profile
ReplicationProfileID uint64 `json:"replication_profile_id"`
// Storage policy ID
StoragePolicyID uint64 `json:"storage_policy_id"`
@@ -56,9 +59,12 @@ type InfoStoragePolicy struct {
// Status of the storage policy
Status string `json:"status"`
// Max IOPS for the sotrage policy
// Max IOPS for the storage policy
LimitIOPS uint64 `json:"limit_iops"`
// ID of the replication profile
ReplicationProfileID uint64 `json:"replication_profile_id"`
// ID of the storage policy
StoragePolicyID uint64 `json:"storage_policy_id"`
@@ -89,3 +95,72 @@ type Usage struct {
// List of resource groups
Resgroups []uint64 `json:"resgroups"`
}
type ListReplicationProfiles struct {
// List
Data []ItemReplicationProfile `json:"data"`
// Entry Count
EntryCount uint64 `json:"entryCount"`
}
type ItemReplicationProfile struct {
// ID of the replication profile
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the replication profile
Name string `json:"name"`
// Replication types
ReplicationType []string `json:"replication_type"`
// Max copy rate
MAXCopyRate uint64 `json:"max_copy_rate"`
// List of schedules
Schedules ListSchedules `json:"schedules"`
}
type InfoReplicationProfile struct {
// ID of the replication profile
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the replication profile
Name string `json:"name"`
// Replication types
ReplicationType []string `json:"replication_type"`
// Max copy rate
MAXCopyRate uint64 `json:"max_copy_rate"`
// List of schedules
Schedules ListSchedules `json:"schedules"`
}
type ListSchedules []Schedule
type Schedule struct {
// Type of the schedule
Type string `json:"type"`
// Name of the schedule
Name string `json:"name"`
// Min interval
MINInterval uint64 `json:"min_interval"`
// Calendar of the schedule
Calendar Calendar `json:"calendar"`
}
type Calendar struct {
// Weekly schedule
Weekly map[string][]string `json:"weekly"`
}
+1 -1
View File
@@ -12,7 +12,7 @@ import (
type SetDataRequest struct {
// Data to set to user in json format
// Required: true
Data string `url:"data" json:"data" validation:"required"`
Data string `url:"data" json:"data" validate:"required"`
}
// SetData sets extra user information.
+4
View File
@@ -42,6 +42,10 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
// Sort by name
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
+6
View File
@@ -54,6 +54,12 @@ type ItemVGPU struct {
// Status
Status string `json:"status"`
// Name
Name string `json:"name"`
// Node ID
NodeID uint64 `json:"node_id"`
}
// List of VGPU
+41 -1
View File
@@ -2,6 +2,7 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
@@ -69,6 +70,11 @@ type CreateInAccountRequest struct {
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
}
type asyncWrapperCreateInAccountRequest struct {
CreateInAccountRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// CreateInAccount creates VINS in account level
func (v VINS) CreateInAccount(ctx context.Context, req CreateInAccountRequest) (uint64, error) {
err := validators.ValidateRequest(req)
@@ -78,7 +84,12 @@ func (v VINS) CreateInAccount(ctx context.Context, req CreateInAccountRequest) (
url := "/cloudapi/vins/createInAccount"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
syncReq := asyncWrapperCreateInAccountRequest{
CreateInAccountRequest: req,
AsyncMode: false,
}
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, syncReq)
if err != nil {
return 0, err
}
@@ -90,3 +101,32 @@ func (v VINS) CreateInAccount(ctx context.Context, req CreateInAccountRequest) (
return result, nil
}
// CreateInAccount creates VINS in account level in async mode
func (v VINS) AsyncCreateInAccount(ctx context.Context, req CreateInAccountRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
asyncReq := asyncWrapperCreateInAccountRequest{
CreateInAccountRequest: req,
AsyncMode: true,
}
url := "/cloudapi/vins/createInAccount"
result, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, asyncReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(result, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+41 -1
View File
@@ -2,6 +2,7 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
@@ -63,6 +64,11 @@ type CreateInRGRequest struct {
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
}
type asyncWrapperCreateInRgRequest struct {
CreateInRGRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
}
// CreateInRG creates VINS in resource group level
func (v VINS) CreateInRG(ctx context.Context, req CreateInRGRequest) (uint64, error) {
err := validators.ValidateRequest(req)
@@ -72,7 +78,12 @@ func (v VINS) CreateInRG(ctx context.Context, req CreateInRGRequest) (uint64, er
url := "/cloudapi/vins/createInRG"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
syncReq := asyncWrapperCreateInRgRequest{
CreateInRGRequest: req,
AsyncMode: false,
}
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, syncReq)
if err != nil {
return 0, err
}
@@ -84,3 +95,32 @@ func (v VINS) CreateInRG(ctx context.Context, req CreateInRGRequest) (uint64, er
return result, nil
}
// CreateInRG creates VINS in resource group level in async mode
func (v VINS) AsyncCreateInRG(ctx context.Context, req CreateInRGRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/createInRG"
syncReq := asyncWrapperCreateInRgRequest{
CreateInRGRequest: req,
AsyncMode: true,
}
result, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, syncReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(result, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+39
View File
@@ -0,0 +1,39 @@
package vins
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// DisableRequest struct to disable VINS
type DisableRequest struct {
// VINS ID
// Required: true
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
}
// Disable disables VINS
func (v VINS) Disable(ctx context.Context, req DisableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/disable"
res, err := v.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
}
-62
View File
@@ -1,62 +0,0 @@
package vins
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// DisableEnableRequest struct to disable/enable VINS
type DisableEnableRequest struct {
// VINS ID
// Required: true
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
}
// Disable disables VINS
func (v VINS) Disable(ctx context.Context, req DisableEnableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/disable"
res, err := v.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
}
// Enable enables VINS
func (v VINS) Enable(ctx context.Context, req DisableEnableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/enable"
res, err := v.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
}
+78
View File
@@ -0,0 +1,78 @@
package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// EnableRequest struct to enable VINS
type EnableRequest struct {
// VINS ID
// Required: true
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
}
type asyncWrapperEnableRequest struct {
EnableRequest
AsyncMode bool `url:"async_mode"`
}
// Enable enables VINS
func (v VINS) Enable(ctx context.Context, req EnableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/enable"
syncReq := asyncWrapperEnableRequest{
EnableRequest: req,
AsyncMode: false,
}
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, syncReq)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
// Enable enables VINS by ID in async mode
func (v VINS) AsyncEnable(ctx context.Context, req EnableRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/enable"
asyncReq := asyncWrapperEnableRequest{
EnableRequest: req,
AsyncMode: true,
}
result, err := v.client.DecortApiCall(ctx, http.MethodPost, url, asyncReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(result, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+6
View File
@@ -340,6 +340,9 @@ type ItemVNFInterface struct {
// List of VNF IDs
VNFs []uint64 `json:"vnfs"`
// Whether default gateway is enabled
EnableDefaultGateway bool `json:"enable_default_gateway"`
}
// Main information about QOS
@@ -630,6 +633,9 @@ type RecordDHCPConfig struct {
// List of reservations
Reservations ListReservations `json:"reservations"`
// Whether default gateway is enabled
EnableDefaultGateway bool `json:"enable_default_gateway"`
}
// List of static routes
+41 -1
View File
@@ -2,6 +2,7 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
@@ -15,6 +16,11 @@ type VNFDevRedeployRequest struct {
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
}
type asyncWrapperVNFDevRedeployRequest struct {
VNFDevRedeployRequest
AsyncMode bool `url:"async_mode"`
}
// VNFDevRedeploy redeploys VINS VNFDevs
func (v VINS) VNFDevRedeploy(ctx context.Context, req VNFDevRedeployRequest) (bool, error) {
err := validators.ValidateRequest(req)
@@ -24,7 +30,12 @@ func (v VINS) VNFDevRedeploy(ctx context.Context, req VNFDevRedeployRequest) (bo
url := "/cloudapi/vins/vnfdevRedeploy"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
syncReq := asyncWrapperVNFDevRedeployRequest{
VNFDevRedeployRequest: req,
AsyncMode: false,
}
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, syncReq)
if err != nil {
return false, err
}
@@ -36,3 +47,32 @@ func (v VINS) VNFDevRedeploy(ctx context.Context, req VNFDevRedeployRequest) (bo
return result, nil
}
// VNFDevRedeploy redeploys VINS VNFDevs in async mode
func (v VINS) AsyncVNFDevRedeploy(ctx context.Context, req VNFDevRedeployRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/vnfdevRedeploy"
asyncReq := asyncWrapperVNFDevRedeployRequest{
VNFDevRedeployRequest: req,
AsyncMode: true,
}
result, err := v.client.DecortApiCall(ctx, http.MethodPost, url, asyncReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(result, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+41 -1
View File
@@ -2,6 +2,7 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
@@ -15,6 +16,11 @@ type VNFDevRestartRequest struct {
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
}
type asyncWrapperVNFDevRestartRequest struct {
VNFDevRestartRequest
AsyncMode bool `url:"async_mode"`
}
// VNFDevRestart reboots VINSes primary VNF device
func (v VINS) VNFDevRestart(ctx context.Context, req VNFDevRestartRequest) (bool, error) {
err := validators.ValidateRequest(req)
@@ -24,7 +30,12 @@ func (v VINS) VNFDevRestart(ctx context.Context, req VNFDevRestartRequest) (bool
url := "/cloudapi/vins/vnfdevRestart"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
syncReq := asyncWrapperVNFDevRestartRequest{
VNFDevRestartRequest: req,
AsyncMode: false,
}
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, syncReq)
if err != nil {
return false, err
}
@@ -36,3 +47,32 @@ func (v VINS) VNFDevRestart(ctx context.Context, req VNFDevRestartRequest) (bool
return result, nil
}
// VNFDevRestart reboots VINSes primary VNF device in async mode
func (v VINS) AsyncVNFDevRestart(ctx context.Context, req VNFDevRestartRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vins/vnfdevRestart"
asyncReq := asyncWrapperVNFDevRestartRequest{
VNFDevRestartRequest: req,
AsyncMode: true,
}
result, err := v.client.DecortApiCall(ctx, http.MethodPost, url, asyncReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(result, &resp)
if err != nil {
return "", err
}
return resp, nil
}
+10
View File
@@ -0,0 +1,10 @@
package cloudapi
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/pkg/cloudapi/vmfolder"
)
// Accessing the VMFolder method group
func (ca *CloudAPI) VMFolder() *vmfolder.VMFolder {
return vmfolder.New(ca.client)
}
+47
View File
@@ -0,0 +1,47 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// AddACLAccessRequest adds ACL access to a vm folder
type AddACLAccessRequest struct {
// ID of a folder
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
// User or group name to grant access
// Required: true
User string `url:"user" json:"user" validate:"required"`
// ID of a folder
// Required: true
Right string `url:"right" json:"right" validate:"required"`
}
// AddACLAccess adds ACL access to a vm folder
func (v VMFolder) AddACLAccess(ctx context.Context, req AddACLAccessRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/add_acl_access"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
+42
View File
@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ComputesMoveRequest struct to move computes to a vm folder
type ComputesMoveRequest struct {
// IDs of computes to move
// Required: true
ComputeIDs []uint64 `url:"compute_ids" json:"compute_ids" validate:"required"`
// Target vm folder ID
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
}
// ComputesMove moves computes to a vm folder
func (v VMFolder) ComputesMove(ctx context.Context, req ComputesMoveRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/computes_move"
res, err := v.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
}
+47
View File
@@ -0,0 +1,47 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// CreateRequest struct to create a vm folder
type CreateRequest struct {
// Resource Group ID
// Required: true
RGID uint64 `url:"rg_id" json:"rg_id" validate:"required"`
// Name
// Required: true
Name string `url:"name" json:"name" validate:"required"`
// Parent ID
// Required: false
ParentID uint64 `url:"parent_id,omitempty" json:"parent_id,omitempty"`
}
// Create creates a vm folder
func (v VMFolder) Create(ctx context.Context, req CreateRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/create"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return 0, err
}
result, err := strconv.ParseUint(string(res), 10, 64)
if err != nil {
return 0, err
}
return result, nil
}
+43
View File
@@ -0,0 +1,43 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// DeleteACLAccessRequest deletes ACL access from a vm folder
type DelACLAccessRequest struct {
// ID of a folder
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
// User or group name to revoke access from
// Required: true
User string `url:"user" json:"user" validate:"required"`
}
// DeleteACLAccess deletes ACL access from a vm foler
func (v VMFolder) DeleteACLAccess(ctx context.Context, req DelACLAccessRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/del_acl_access"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
+38
View File
@@ -0,0 +1,38 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// DeleteRequest struct to delete a VM folder
type DeleteRequest struct {
// ID of a folder to delete
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
}
// Delete deletes a vm folder
func (v VMFolder) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/delete"
res, err := v.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
}
+46
View File
@@ -0,0 +1,46 @@
package vmfolder
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetRequest struct to get detailed information about a vm folder
type GetRequest struct {
// ID of a folder
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
}
// Get gets current configuration of the vm folder as a RecordVMFolder struct
func (v VMFolder) Get(ctx context.Context, req GetRequest) (*RecordVMFolder, error) {
res, err := v.GetRaw(ctx, req)
if err != nil {
return nil, err
}
info := RecordVMFolder{}
err = json.Unmarshal(res, &info)
if err != nil {
return nil, err
}
return &info, nil
}
// GetRaw gets current configuration of the vm folder as an array of bytes
func (v VMFolder) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/get"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}
+55
View File
@@ -0,0 +1,55 @@
package vmfolder
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ListRequest struct to get list of vm folders
type ListRequest struct {
// Resource group ID
// Required: true
RGID uint64 `url:"rg_id" json:"rg_id" validate:"required"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// List gets list of all vm folders in a resource group as a ListVMFolder struct
func (v VMFolder) List(ctx context.Context, req ListRequest) (*ListVMFolder, error) {
res, err := v.ListRaw(ctx, req)
if err != nil {
return nil, err
}
list := ListVMFolder{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}
// ListRaw gets list of all vm folders in a resource group as an array of bytes
func (v VMFolder) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/list"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}
+79
View File
@@ -0,0 +1,79 @@
package vmfolder
// Detailed information about a folder
type RecordVMFolder struct {
// ID
ID uint64 `json:"id"`
// RG ID
RGID uint64 `json:"rg_id"`
// GID
GID uint64 `json:"gid"`
// Name of a folder
Name string `json:"name"`
// ACL
ACL []ACL `json:"acl"`
// Time of creation
CreatedTime uint64 `json:"created_time"`
// Parent ID
ParentID uint64 `json:"parent_id"`
// Status of a folder
Status string `json:"status"`
// Compute IDs
ComputeIDs []uint64 `json:"compute_ids"`
}
// ACL
type ACL struct {
// Explicit
Explicit bool `json:"explicit"`
// Right
Right string `json:"right"`
// Status
Status string `json:"status"`
// Type
Type string `json:"type"`
// User group ID
UserGroupID string `json:"userGroupId"`
}
// List of vm folders
type ListVMFolder struct {
// Entry count
EntryCount uint64 `json:"entryCount"`
// Data
Data []ItemVMFolder `json:"data"`
}
// Detailed information about a folder item
type ItemVMFolder struct {
// Folder ID
ID uint64 `json:"id"`
// Parent ID
ParentID uint64 `json:"parent_id"`
// Name
Name string `json:"name"`
// ACL
ACL []ACL `json:"acl"`
// Status
Status string `json:"status"`
// VM count
VMCount uint64 `json:"vm_count"`
}
+42
View File
@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// MoveRequest to move a vm folder to a compute
type MoveRequest struct {
// VM Folder ID
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id"`
// New parent folder ID
// Required: true
NewParentID uint64 `url:"new_parent_id" json:"new_parent_id"`
}
// Move moves a vm folder to a compute
func (v VMFolder) Move(ctx context.Context, req MoveRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/move"
res, err := v.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
}
+42
View File
@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// RenameRequest struct to rename a VM folder
type RenameRequest struct {
// ID of a folder to rename
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
// A new name
// Required: true
Name string `url:"name" json:"name" validate:"required"`
}
// Rename renames a vm folder
func (v VMFolder) Rename(ctx context.Context, req RenameRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/rename"
res, err := v.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
}
+17
View File
@@ -0,0 +1,17 @@
package vmfolder
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/interfaces"
)
// Structure for creating request to VMFolder
type VMFolder struct {
client interfaces.Caller
}
// Builder for VMFolder endpoints
func New(client interfaces.Caller) *VMFolder {
return &VMFolder{
client,
}
}
+9 -7
View File
@@ -2,8 +2,8 @@ package apiaccess
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
@@ -20,23 +20,25 @@ type DescUpdateRequest struct {
}
// DescUpdate sets a new text description of the apiaccess group.
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (bool, error) {
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (*ItemAPIAccess, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/apiaccess/descUpdate"
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
return nil, err
}
result, err := strconv.ParseBool(string(res))
info := ItemAPIAccess{}
err = json.Unmarshal(res, &info)
if err != nil {
return false, err
return nil, err
}
return result, nil
return &info, nil
}
Loaded 100 of 265 files, more files were not shown because too many files have changed in this diff. Show more