Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70edc100d5 | ||
|
|
025a1274f4 | ||
|
|
dca445b69a |
No files matched your search
+232
-70
@@ -1,15 +1,23 @@
|
|||||||
## Version 16.4.0
|
## Version 16.7.0
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
Перечисленные методы будут удалены в `v1.17`
|
Перечисленные методы будут удалены в `v17.0.0`
|
||||||
|
|
||||||
| Метод | CloudAPI | CloudBroker |
|
| Метод | CloudAPI | CloudBroker |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `account/AddUser` | :heavy_check_mark: | :heavy_check_mark: |
|
| `account/AddUser` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| `account/DeleteUser` | :heavy_check_mark: | :heavy_check_mark: |
|
| `account/DeleteUser` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| `account/UpdateUser` | :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/UserGrant` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| `compute/UserList` | :heavy_check_mark: | :heavy_check_mark: |
|
| `compute/UserList` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| `compute/UserRevoke` | :heavy_check_mark: | :heavy_check_mark: |
|
| `compute/UserRevoke` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
@@ -17,99 +25,253 @@
|
|||||||
| `rg/AccessGrant` | :heavy_check_mark: | :heavy_check_mark: |
|
| `rg/AccessGrant` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| `rg/AccessRevoke` | :heavy_check_mark: | :heavy_check_mark: |
|
| `rg/AccessRevoke` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| `sep/ConfigFieldEdit` | :x: | :heavy_check_mark: |
|
| `sep/ConfigFieldEdit` | :x: | :heavy_check_mark: |
|
||||||
|
| `apiaccess/userList` | :x: | :heavy_check_mark: |
|
||||||
|
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### apiaccess
|
|
||||||
| Идентификатор задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1055 | Структура `SDNEndpoints` и опциональное поле `SDN` в структуру `APIsEndpoints` в cloudbroker/apiaccess |
|
|
||||||
| BGOS-1055 | Опциональные поля `Audit`, `DPDKNet`, `SecurityGroup`, `SEP`, `StoragePolicy`, `Trunk`, `VFPool`, `VMFolder`, `Zone` в структуру `CloudAPIEndpoints` в cloudbroker/apiaccess |
|
|
||||||
| BGOS-1055 | Опциональные поля `Backup`, `DPDKNet`, `SecurityGroup`, `StoragePolicy`, `Trunk`, `VFPool`, `VMFolder`, `Zone` в структуру `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
|
||||||
| BGOS-1055 | Опциональные поля `Cache`, `InfoWellknown` в структуру `SystemEndpoints` в cloudbroker/apiaccess |
|
|
||||||
|
|
||||||
#### compute
|
#### compute
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1043 | Опциональное поле `AsyncMode` в структуру запроса `SnapshotEvictDiskRequest` в cloudbroker/compute |
|
| BGOS-1111 | Опциональное поле `Planned` в структуру запроса `DiskSwitchToReplicationRequest` в cloudapi/compute |
|
||||||
| BGOS-1044 | Методы `AsyncAffinityRuleAdd` и `AsyncAntiAffinityRuleAdd` в cloudapi/compute и cloudbroker/compute |
|
| BGOS-1111 | Опциональное поле `Planned` в структуру запроса `DiskSwitchToReplicationRequest` в cloudbroker/compute |
|
||||||
| BGOS-1054 | Опциональные поля `FolderID` и `IncludeDescendants` в структуру запроса `ListRequest` в cloudapi/compute |
|
| BGOS-1118 | Вычисляемое поле `CRTTracking` в структуру ответа `ItemComputeDisk` в cloudapi/compute |
|
||||||
| BGOS-1054 | Опциональные поля `FolderID` и `IncludeDescendants` в структуру запроса `ListRequest` в cloudbroker/compute |
|
| BGOS-1118 | Вычисляемое поле `CRTTracking` в структуру ответа `ItemDisk` в cloudbroker/compute |
|
||||||
| BGOS-1046 | Опциональное поле `Migrate` в структуры запросов `AffinityRuleAddRequest` и `AntiAffinityRuleAddRequest` в cloudapi/compute |
|
| BGOS-1120 | Структура запроса `wrapperMigrateStorageRequest` и метод `MigrateStorageAsync` в cloudbroker/compute |
|
||||||
| BGOS-1046 | Опциональное поле `Migrate` в структуры запросов `AffinityRuleAddRequest` и `AntiAffinityRuleAddRequest` в cloudbroker/compute |
|
|
||||||
|
|
||||||
#### session
|
|
||||||
| Идентификатор задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1048 | Опциональное поле `IncludeArchive` в структуру запроса `ListRequest` в cloudbroker/session |
|
|
||||||
|
|
||||||
#### stpolicy
|
|
||||||
| Идентификатор задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1047 | Вычисляемое поле `ReplicationProfileID` в структуры ответа `InfoStoragePolicy` и `ItemStoragePolicy` в cloudapi/stpolicy и в cloudbroker/stpolicy |
|
|
||||||
| BGOS-1047 | Вычисляемое поле `ReplicationProfileID` в структуру ответа `InfoStoragePolicyWithID` в cloudbroker/stpolicy |
|
|
||||||
| BGOS-1047 | Методы `GetReplicationProfile`, `ListReplicationProfile`, структуры запроса `GetReplicationProfileRequest`, `ListReplicationProfileRequest` и структуры ответа `InfoReplicationProfile`, `ListReplicationProfiles`, `ItemReplicationProfile`, `ListSchedules`, `Schedule`, `Calendar` в cloudapi/stpolicy и в cloudbroker/stpolicy |
|
|
||||||
| BGOS-1047 | Метод `CreateReplicationProfile`, структуры запроса `CreateReplicationProfileRequest`, `SchedulesRequest`, `CalendarRequest` в cloudbroker/stpolicy |
|
|
||||||
| BGOS-1047 | Метод `UpdateReplicationProfile`, структуры запроса `UpdateReplicationProfileRequest`, `ConfigRequest` в cloudbroker/stpolicy |
|
|
||||||
| BGOS-1047 | Метод `DeleteReplicationProfile` и структура запроса `DeleteReplicationProfileRequest` в cloudbroker/stpolicy |
|
|
||||||
| BGOS-1047 | Методы `AddAccessReplicationProfile`, `RevokeAccessReplicationProfile` и структуры запроса `AddAccessReplicationProfileRequest`, `RevokeAccessReplicationProfileRequest` в cloudbroker/stpolicy |
|
|
||||||
|
|
||||||
#### vmfolder
|
|
||||||
| Идентификатор задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1049 | Группа апи методов vmfolder в cloudapi и cloudbroker |
|
|
||||||
|
|
||||||
### Изменено
|
|
||||||
|
|
||||||
#### backup
|
|
||||||
| Идентификатор задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1045 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структурах запроса `CreateDiskBackupRequest`, `CreateDisksBackupRequest`, `DeleteDiskBackupRequest`, `RestoreDiskFromBackupRequest` и `RestoreDisksFromBackupRequest` в cloudbroker/backup |
|
|
||||||
|
|
||||||
#### compute
|
|
||||||
| Идентификатор задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-1043 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структурах запроса `AbortSharedSnapshotMergeRequest`, `CDEjectRequest`, `CDInsertRequest`, `ChangeIPRequest`, `ChangeLinkStateRequest`, `ChangeMTURequest`, `ChangeQoSPoliciesRequest`, `ChangeSecGroupsRequest`, `CloneRequest`, `CreateTemplateRequest`, `CreateTemplateFromBlankRequest`, `DeleteRequest`, `DisableRequest`, `DiskAddRequest`, `DiskAttachRequest`, `DiskDelRequest`, `DiskDetachRequest`, `DiskQOSRequest`, `DiskResizeRequest`, `DiskSwitchToReplicationRequest`, `GuestAgentDisableRequest`, `GuestAgentEnableRequest`, `GuestAgentExecuteRequest`, `GuestAgentFeatureUpdateRequest`, `MigrateToZoneRequest`, `MoveToRGRequest`, `NetAttachRequest`, `NetDetachRequest`, `PauseRequest`, `PFWAddRequest`, `PFWDelRequest`, `PinToNodeRequest`, `PowerCycleRequest`, `RebootRequest`, `RedeployRequest`, `ResetRequest`, `ResizeRequest`, `RestoreRequest`, `ResumeRequest`, `SnapshotCreateRequest`, `SnapshotDeleteRequest`, `SnapshotRollbackRequest`, `StartRequest` и `StopRequest` в cloudapi/compute |
|
|
||||||
| BGOS-1043 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структурах запроса `AbortSharedSnapshotMergeRequest`, `CDEjectRequest`, `CDInsertRequest`, `ChangeIPRequest`, `ChangeLinkStateRequest`, `ChangeMTURequest`, `ChangeQoSPoliciesRequest`, `ChangeSecGroupsRequest`, `CloneRequest`, `CreateTemplateRequest`, `CreateTemplateFromBlankRequest`, `DeleteRequest`, `DisableRequest`, `DiskAddRequest`, `DiskAttachRequest`, `DiskDelRequest`, `DiskDetachRequest`, `DiskQOSRequest`, `DiskResizeRequest`, `DiskSwitchToReplicationRequest`, `GuestAgentDisableRequest`, `GuestAgentEnableRequest`, `GuestAgentExecuteRequest`, `GuestAgentFeatureUpdateRequest`, `MassDeleteRequest`, `MassRebootRequest`, `MassStartRequest`, `MassStopRequest`, `MigrateAbortRequest`, `MigrateStorageAbortRequest`, `MigrateStorageCleanUpRequest`, `MigrateToZoneRequest`, `MoveToRGRequest`, `NetAttachRequest`, `NetDetachRequest`, `NetQOSRequest`, `PauseRequest`, `PFWAddRequest`, `PFWDelRequest`, `PinToNodeRequest`, `PowerCycleRequest`, `RaiseDownRequest`, `RebootRequest`, `RedeployRequest`, `ResetRequest`, `ResizeRequest`, `RestoreRequest`, `ResumeRequest`, `SnapshotCreateRequest`, `SnapshotDeleteRequest`, `SnapshotRollbackRequest`, `StartRequest` и `StopRequest` в cloudbroker/compute |
|
|
||||||
| BGOS-1043 | Опциональное поле `SyncMode` на `AsyncMode` в структуре запроса `MigrateRequest` в cloudbroker/compute |
|
|
||||||
| BGOS-1043 | Опциональное поле `Sync` на `Async` в структуре запроса `MigrateStorageRequest` в cloudbroker/compute |
|
|
||||||
|
|
||||||
#### disks
|
#### disks
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1045 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `FromPlatformDiskRequest` в cloudapi/disks и в cloudbroker/disks |
|
| 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 |
|
||||||
|
|
||||||
#### image
|
#### dpdknet
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1045 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `CreateRequest` в cloudapi/image и в cloudbroker/image |
|
| BGOS-1116 | Опциональные поля `AccountAccess` и `RGAccess` в структуру запроса `ListRequest` в cloudapi/dpdknet |
|
||||||
| BGOS-1045 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `CreateCDROMImageRequest` в cloudbroker/image |
|
|
||||||
|
|
||||||
#### kvmx86
|
#### pcidevice
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1045 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `MassCreateRequest` в cloudbroker/kvmx86 |
|
| BGOS-1115 | Опциональное поле `NodeID` в структуру запроса `ListRequest` в cloudbroker/pcidevice |
|
||||||
|
| BGOS-1115 | Опциональное поле `NodeID` в структуру запроса `ListRequest` в cloudapi/pcidevice |
|
||||||
|
|
||||||
#### node
|
#### SDN defsecpolicies
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1045 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `EnableRequest` в cloudbroker/node |
|
| 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 |
|
||||||
|
|
||||||
|
### Изменено
|
||||||
|
|
||||||
|
#### 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 |
|
||||||
|
|
||||||
|
|
||||||
### Исправлено
|
### Исправлено
|
||||||
|
|
||||||
#### apiaccess
|
#### SDN secpolicies
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1055 | Ошибка при вызове метода `Update` в cloudbroker/apiaccess |
|
| BGOS-1104 | URL метода `Get` с `/sdn/security_policies/get` на `/sdn/security_policy/get` в sdn/secpolicies |
|
||||||
| BGOS-1055 | Исправлен тип ответа метода `DescUpdate` в cloudbroker/apiaccess |
|
| BGOS-1104 | Тип поля `InsertUp` с обязательного на опциональный в структуре запроса `MoveRequest` в sdn/secpolicies |
|
||||||
|
|
||||||
|
### Удалено
|
||||||
|
|
||||||
#### Удалено
|
#### SDN defsecpolicies
|
||||||
|
|
||||||
#### apiaccess
|
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-1055 | Структура `LibCloudEndpoints` и опциональное поле `LibCloud` из структуры `APIsEndpoints` в cloudbroker/apiaccess |
|
| BGOS-1103 | Вычисляемые поля `Description`, `LockedAt` и `Status` из структуры ответа `SecurityPolicy` в sdn/defsecpolicies |
|
||||||
| BGOS-1055 | Опциональные поля `CloudSpace`, `ComputeCI`, `DPDK`, `Machine`, `Openshift`, `OpenshiftCI`, `PortForwarding`, `Sizes` из структуры `CloudAPIEndpoints` в cloudbroker/apiaccess |
|
| BGOS-1103 | Вычисляемые поля `Description`, `DestinationNetObject`, `LogName`, `LogSeverity`, `SecurityPolicyID` и `SourceNetObject` из структуры ответа `SecurityRule` в sdn/defsecpolicies |
|
||||||
| BGOS-1055 | Опциональные поля `CloudSpace`, `ComputeCI`, `Desnode`, `Diagnostics`, `DPDK`, `IaaS`, `Machine`, `Openshift`, `OpenshiftCI`, `Ovsnode`, `QOS` из структуры `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
| BGOS-1103 | Вычисляемое поле `DHCP` из структуры ответа `FilterParams` в sdn/defsecpolicies |
|
||||||
| BGOS-1055 | Опциональные поля `AgentController`, `Alerts`, `ErrorConditionHandler`, `Job`, `Log`, `Logo` из структуры `SystemEndpoints` в cloudbroker/apiaccess |
|
| 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 |
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ type ListVINSRequest struct {
|
|||||||
|
|
||||||
// Find by VINS ID
|
// Find by VINS ID
|
||||||
// Required: false
|
// Required: false
|
||||||
VINSID uint64 `url:"vins,omitempty" json:"vinsId,omitempty"`
|
VINSID uint64 `url:"vinsId,omitempty" json:"vinsId,omitempty"`
|
||||||
|
|
||||||
// Find by name
|
// Find by name
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
|
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
|
// Find by vins id
|
||||||
// Required: false
|
// Required: false
|
||||||
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"`
|
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"`
|
ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
|
||||||
|
|
||||||
// Public Session ID
|
// 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
|
// List gets audit records for the specified account object
|
||||||
|
|||||||
@@ -88,6 +88,42 @@ type ItemAudit struct {
|
|||||||
|
|
||||||
// TTL
|
// TTL
|
||||||
TTL string `json:"_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
|
// List of audits
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -51,14 +52,14 @@ type AffinityRuleAddRequest struct {
|
|||||||
type wrapperAffinityRuleAddRequest struct {
|
type wrapperAffinityRuleAddRequest struct {
|
||||||
AffinityRuleAddRequest
|
AffinityRuleAddRequest
|
||||||
|
|
||||||
AsyncMode bool `url:"async_mode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AffinityRuleAdd add affinity rule
|
// 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)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return AffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudapi/compute/affinityRuleAdd"
|
url := "/cloudapi/compute/affinityRuleAdd"
|
||||||
@@ -68,17 +69,24 @@ func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest
|
|||||||
AsyncMode: false,
|
AsyncMode: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return AffinityRuleAddResult{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !req.Migrate {
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseBool(string(res))
|
||||||
if err != nil {
|
return AffinityRuleAddResult{Ok: result}, err
|
||||||
return false, 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
|
// AsyncAffinityRuleAdd add affinity rule in async mode
|
||||||
@@ -95,7 +103,7 @@ func (c Compute) AsyncAffinityRuleAdd(ctx context.Context, req AffinityRuleAddRe
|
|||||||
AsyncMode: true,
|
AsyncMode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -51,14 +52,14 @@ type AntiAffinityRuleAddRequest struct {
|
|||||||
type wrapperAntiAffinityRuleAddRequest struct {
|
type wrapperAntiAffinityRuleAddRequest struct {
|
||||||
AntiAffinityRuleAddRequest
|
AntiAffinityRuleAddRequest
|
||||||
|
|
||||||
AsyncMode bool `url:"async_mode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiAffinityRuleAdd add anti affinity rule
|
// 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)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return AntiAffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudapi/compute/antiAffinityRuleAdd"
|
url := "/cloudapi/compute/antiAffinityRuleAdd"
|
||||||
@@ -68,17 +69,24 @@ func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAd
|
|||||||
AsyncMode: false,
|
AsyncMode: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return AntiAffinityRuleAddResult{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !req.Migrate {
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseBool(string(res))
|
||||||
if err != nil {
|
return AntiAffinityRuleAddResult{Ok: result}, err
|
||||||
return false, 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
|
// AsyncAntiAffinityRuleAdd add anti affinity rule in async mode
|
||||||
@@ -95,7 +103,7 @@ func (c Compute) AsyncAntiAffinityRuleAdd(ctx context.Context, req AntiAffinityR
|
|||||||
AsyncMode: true,
|
AsyncMode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ type CreateTemplateFromBlankRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Password string `url:"password,omitempty" json:"password,omitempty"`
|
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
|
// Pool for image create
|
||||||
// Required: false
|
// Required: false
|
||||||
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
|
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ type wrapperDiskQOSRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DiskQOS change QoS of the disk
|
// 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) {
|
func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
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
|
// 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) {
|
func (c Compute) DiskQOSAsync(ctx context.Context, req DiskQOSRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -20,7 +20,11 @@ type DiskSwitchToReplicationRequest struct {
|
|||||||
|
|
||||||
// Delete replication relationship
|
// Delete replication relationship
|
||||||
// Required: false
|
// 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 {
|
type wrapperDiskSwitchToReplicationRequest struct {
|
||||||
|
|||||||
@@ -575,6 +575,9 @@ type RecordCompute struct {
|
|||||||
// Zone ID
|
// Zone ID
|
||||||
// Required: false
|
// Required: false
|
||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
|
// Folder ID
|
||||||
|
FolderID uint64 `json:"folder_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detailed information about ACL Access in a compute
|
// Detailed information about ACL Access in a compute
|
||||||
@@ -1104,6 +1107,9 @@ type ItemComputeDisk struct {
|
|||||||
// Created time
|
// Created time
|
||||||
CreatedTime uint64 `json:"createdTime"`
|
CreatedTime uint64 `json:"createdTime"`
|
||||||
|
|
||||||
|
// Whether CRT tracking is enabled
|
||||||
|
CRTTracking bool `json:"crt_tracking"`
|
||||||
|
|
||||||
// Device name
|
// Device name
|
||||||
DeviceName string `json:"devicename"`
|
DeviceName string `json:"devicename"`
|
||||||
|
|
||||||
@@ -1564,6 +1570,9 @@ type ItemCompute struct {
|
|||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
|
// Folder ID
|
||||||
|
FolderID uint64 `json:"folder_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListInfoDisks
|
// ListInfoDisks
|
||||||
@@ -1743,3 +1752,47 @@ type CloneStatus struct {
|
|||||||
// Progress percent
|
// Progress percent
|
||||||
ProgressPercent int `json:"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
|
||||||
|
}
|
||||||
@@ -82,7 +82,7 @@ type UpdateRequest struct {
|
|||||||
|
|
||||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
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
|
// ID of the storage policy to which to connect for disk
|
||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
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 {
|
type wrapperChangeDiskStoragePolicyRequest struct {
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ type FromPlatformDiskRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Password string `url:"password,omitempty" json:"password,omitempty"`
|
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
|
// Pool for image create
|
||||||
// Required: false
|
// Required: false
|
||||||
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
|
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
|
||||||
|
|||||||
@@ -67,6 +67,30 @@ type LimitIORequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
WriteIOPSSecMax uint64 `url:"write_iops_sec_max,omitempty" json:"write_iops_sec_max,omitempty"`
|
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
|
// SizeIOPSSec
|
||||||
// Required: false
|
// Required: false
|
||||||
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
|
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
|
||||||
|
|||||||
@@ -154,6 +154,9 @@ type ItemDisk struct {
|
|||||||
|
|
||||||
// Cache mode of disk
|
// Cache mode of disk
|
||||||
Cache string `json:"cache"`
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
|
// Whether CRT is tracked
|
||||||
|
CRTTracking bool `json:"crt_tracking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemDiskUnattached struct {
|
type ItemDiskUnattached struct {
|
||||||
@@ -300,6 +303,9 @@ type ItemDiskUnattached struct {
|
|||||||
|
|
||||||
// Virtual machine ID
|
// Virtual machine ID
|
||||||
VMID uint64 `json:"vmid"`
|
VMID uint64 `json:"vmid"`
|
||||||
|
|
||||||
|
// Whether CRT is tracked
|
||||||
|
CRTTracking bool `json:"crt_tracking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of disks searched
|
// List of disks searched
|
||||||
@@ -549,6 +555,9 @@ type RecordDisk struct {
|
|||||||
|
|
||||||
// Cache mode of disk
|
// Cache mode of disk
|
||||||
Cache string `json:"cache"`
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
|
// Whether CRT is tracked
|
||||||
|
CRTTracking bool `json:"crt_tracking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemReplication struct {
|
type ItemReplication struct {
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ type ReplicateRequest struct {
|
|||||||
// ID of the storage policy under the disk will be created
|
// ID of the storage policy under the disk will be created
|
||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
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 {
|
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
|
||||||
|
}
|
||||||
@@ -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
|
// Id of the disk
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
|
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 {
|
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
|
||||||
|
}
|
||||||
@@ -18,6 +18,14 @@ type ReplicationStartRequest struct {
|
|||||||
// ID of target disk. Secondary disk in replication
|
// ID of target disk. Secondary disk in replication
|
||||||
// Required: true
|
// Required: true
|
||||||
TargetDiskID uint64 `url:"targetDiskId" json:"targetDiskId" validate:"required"`
|
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 {
|
type wrapperReplicationStartRequest struct {
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
ComputeIDs []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
|
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)
|
// Sort by one of supported fields, format +|-(field)
|
||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ type ItemReservation struct {
|
|||||||
// Account ID
|
// Account ID
|
||||||
AccountID uint64 `json:"account_id"`
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
|
// Auto assignable
|
||||||
|
AutoAssignable bool `json:"auto_assignable"`
|
||||||
|
|
||||||
// ClientType
|
// ClientType
|
||||||
ClientType string `json:"clientType"`
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
@@ -127,6 +130,12 @@ type VNFs struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Excluded struct {
|
type Excluded struct {
|
||||||
|
// Account ID
|
||||||
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
|
// Auto assignable
|
||||||
|
AutoAssignable bool `json:"auto_assignable"`
|
||||||
|
|
||||||
// ClientType
|
// ClientType
|
||||||
ClientType string `json:"clientType"`
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
|
|||||||
@@ -230,6 +230,10 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
|
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
|
// Zone ID
|
||||||
// Required: false
|
// Required: false
|
||||||
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
||||||
@@ -250,8 +254,12 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
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
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ type CreateBlankRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
|
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
|
// VM type linux, windows or unknown
|
||||||
// Required: false
|
// Required: false
|
||||||
LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"`
|
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"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
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
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
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
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
type SetDataRequest struct {
|
type SetDataRequest struct {
|
||||||
// Data to set to user in json format
|
// Data to set to user in json format
|
||||||
// Required: true
|
// Required: true
|
||||||
Data string `url:"data" json:"data" validation:"required"`
|
Data string `url:"data" json:"data" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetData sets extra user information.
|
// SetData sets extra user information.
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
|
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
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ type ItemVGPU struct {
|
|||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Node ID
|
||||||
|
NodeID uint64 `json:"node_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of VGPU
|
// List of VGPU
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type CreateInAccountRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperCreateInAccountRequest struct {
|
type asyncWrapperCreateInAccountRequest struct {
|
||||||
CreateInAccountRequest
|
CreateInAccountRequest
|
||||||
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateInAccount creates VINS in account level
|
// CreateInAccount creates VINS in account level
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ type CreateInRGRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperCreateInRgRequest struct {
|
type asyncWrapperCreateInRgRequest struct {
|
||||||
CreateInRGRequest
|
CreateInRGRequest
|
||||||
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateInRG creates VINS in resource group level
|
// CreateInRG creates VINS in resource group level
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type EnableRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperEnableRequest struct {
|
type asyncWrapperEnableRequest struct {
|
||||||
EnableRequest
|
EnableRequest
|
||||||
AsyncMode bool `url:"asyncMode"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable enables VINS
|
// Enable enables VINS
|
||||||
|
|||||||
@@ -340,6 +340,9 @@ type ItemVNFInterface struct {
|
|||||||
|
|
||||||
// List of VNF IDs
|
// List of VNF IDs
|
||||||
VNFs []uint64 `json:"vnfs"`
|
VNFs []uint64 `json:"vnfs"`
|
||||||
|
|
||||||
|
// Whether default gateway is enabled
|
||||||
|
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main information about QOS
|
// Main information about QOS
|
||||||
@@ -630,6 +633,9 @@ type RecordDHCPConfig struct {
|
|||||||
|
|
||||||
// List of reservations
|
// List of reservations
|
||||||
Reservations ListReservations `json:"reservations"`
|
Reservations ListReservations `json:"reservations"`
|
||||||
|
|
||||||
|
// Whether default gateway is enabled
|
||||||
|
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of static routes
|
// List of static routes
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type VNFDevRedeployRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperVNFDevRedeployRequest struct {
|
type asyncWrapperVNFDevRedeployRequest struct {
|
||||||
VNFDevRedeployRequest
|
VNFDevRedeployRequest
|
||||||
AsyncMode bool `url:"asyncMode"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VNFDevRedeploy redeploys VINS VNFDevs
|
// VNFDevRedeploy redeploys VINS VNFDevs
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type VNFDevRestartRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperVNFDevRestartRequest struct {
|
type asyncWrapperVNFDevRestartRequest struct {
|
||||||
VNFDevRestartRequest
|
VNFDevRestartRequest
|
||||||
AsyncMode bool `url:"asyncMode"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VNFDevRestart reboots VINSes primary VNF device
|
// VNFDevRestart reboots VINSes primary VNF device
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
|
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
|
||||||
|
|
||||||
|
// Filter by user ID
|
||||||
|
// Required: false
|
||||||
|
UserID string `url:"user_id,omitempty" json:"user_id,omitempty"`
|
||||||
|
|
||||||
// Page number
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
@@ -161,51 +161,51 @@ type CloudAPIEndpoints struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CloudBrokerEndpoints struct {
|
type CloudBrokerEndpoints struct {
|
||||||
Account []string `json:"account,omitempty"`
|
Account interface{} `json:"account,omitempty"`
|
||||||
APIAccess []string `json:"apiaccess,omitempty"`
|
APIAccess interface{} `json:"apiaccess,omitempty"`
|
||||||
Audit interface{} `json:"audit,omitempty"`
|
Audit interface{} `json:"audit,omitempty"`
|
||||||
AuditBeat []string `json:"auditbeat,omitempty"`
|
AuditBeat []string `json:"auditbeat,omitempty"`
|
||||||
AuditCollector []string `json:"auditcollector,omitempty"`
|
AuditCollector interface{} `json:"auditcollector,omitempty"`
|
||||||
Backup []string `json:"backup,omitempty"`
|
Backup interface{} `json:"backup,omitempty"`
|
||||||
BackupCreator []string `json:"backupcreator,omitempty"`
|
BackupCreator interface{} `json:"backupcreator,omitempty"`
|
||||||
BService []string `json:"bservice,omitempty"`
|
BService interface{} `json:"bservice,omitempty"`
|
||||||
Compute []string `json:"compute,omitempty"`
|
Compute interface{} `json:"compute,omitempty"`
|
||||||
Disks []string `json:"disks,omitempty"`
|
Disks interface{} `json:"disks,omitempty"`
|
||||||
DPDKNet []string `json:"dpdknet,omitempty"`
|
DPDKNet interface{} `json:"dpdknet,omitempty"`
|
||||||
Eco []string `json:"eco,omitempty"`
|
Eco interface{} `json:"eco,omitempty"`
|
||||||
ExtNet []string `json:"extnet,omitempty"`
|
ExtNet interface{} `json:"extnet,omitempty"`
|
||||||
FlIPgroup []string `json:"flipgroup,omitempty"`
|
FlIPgroup interface{} `json:"flipgroup,omitempty"`
|
||||||
Grid []string `json:"grid,omitempty"`
|
Grid interface{} `json:"grid,omitempty"`
|
||||||
Group []string `json:"group,omitempty"`
|
Group interface{} `json:"group,omitempty"`
|
||||||
Health []string `json:"health,omitempty"`
|
Health interface{} `json:"health,omitempty"`
|
||||||
Image []string `json:"image,omitempty"`
|
Image interface{} `json:"image,omitempty"`
|
||||||
Job interface{} `json:"job,omitempty"`
|
Job interface{} `json:"job,omitempty"`
|
||||||
K8CI []string `json:"k8ci,omitempty"`
|
K8CI interface{} `json:"k8ci,omitempty"`
|
||||||
K8S []string `json:"k8s,omitempty"`
|
K8S interface{} `json:"k8s,omitempty"`
|
||||||
KVMX86 []string `json:"kvmx86,omitempty"`
|
KVMX86 interface{} `json:"kvmx86,omitempty"`
|
||||||
LB []string `json:"lb,omitempty"`
|
LB interface{} `json:"lb,omitempty"`
|
||||||
Metering []string `json:"metering,omitempty"`
|
Metering interface{} `json:"metering,omitempty"`
|
||||||
Milestones []string `json:"milestones,omitempty"`
|
Milestones interface{} `json:"milestones,omitempty"`
|
||||||
Node []string `json:"node,omitempty"`
|
Node []string `json:"node,omitempty"`
|
||||||
PCIDevice []string `json:"pcidevice,omitempty"`
|
PCIDevice interface{} `json:"pcidevice,omitempty"`
|
||||||
PGPU []string `json:"pgpu,omitempty"`
|
PGPU interface{} `json:"pgpu,omitempty"`
|
||||||
Prometheus []string `json:"prometheus,omitempty"`
|
Prometheus interface{} `json:"prometheus,omitempty"`
|
||||||
Resmon interface{} `json:"resmon,omitempty"`
|
Resmon interface{} `json:"resmon,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
RG interface{} `json:"rg,omitempty"`
|
||||||
SecurityGroup []string `json:"security_group,omitempty"`
|
SecurityGroup interface{} `json:"security_group,omitempty"`
|
||||||
Sep []string `json:"sep,omitempty"`
|
Sep interface{} `json:"sep,omitempty"`
|
||||||
StoragePolicy []string `json:"storage_policy,omitempty"`
|
StoragePolicy interface{} `json:"storage_policy,omitempty"`
|
||||||
Tasks []string `json:"tasks,omitempty"`
|
Tasks interface{} `json:"tasks,omitempty"`
|
||||||
TLock []string `json:"tlock,omitempty"`
|
TLock interface{} `json:"tlock,omitempty"`
|
||||||
Trunk []string `json:"trunk,omitempty"`
|
Trunk interface{} `json:"trunk,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
User interface{} `json:"user,omitempty"`
|
||||||
VFPool []string `json:"vfpool,omitempty"`
|
VFPool interface{} `json:"vfpool,omitempty"`
|
||||||
VGPU []string `json:"vgpu,omitempty"`
|
VGPU interface{} `json:"vgpu,omitempty"`
|
||||||
VINS []string `json:"vins,omitempty"`
|
VINS interface{} `json:"vins,omitempty"`
|
||||||
VMFolder []string `json:"vmfolder,omitempty"`
|
VMFolder interface{} `json:"vmfolder,omitempty"`
|
||||||
VNFDev []string `json:"vnfdev,omitempty"`
|
VNFDev interface{} `json:"vnfdev,omitempty"`
|
||||||
ZeroAccess []string `json:"zeroaccess,omitempty"`
|
ZeroAccess interface{} `json:"zeroaccess,omitempty"`
|
||||||
Zone []string `json:"zone,omitempty"`
|
Zone interface{} `json:"zone,omitempty"`
|
||||||
All bool `json:"ALL,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type UpdateRequest struct {
|
|||||||
APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"`
|
APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"`
|
||||||
|
|
||||||
// APIs to remove from APIAccess group
|
// APIs to remove from APIAccess group
|
||||||
// Required: false
|
// Required: true
|
||||||
APIs APIsEndpoints `url:"-" json:"-"`
|
APIs APIsEndpoints `url:"-" json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ type UserListRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UserList gets a list of users currently included in the specified group.
|
// UserList gets a list of users currently included in the specified group.
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (a APIAccess) UserList(ctx context.Context, req UserListRequest) ([]string, error) {
|
func (a APIAccess) UserList(ctx context.Context, req UserListRequest) ([]string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
|
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
|
// Find by vins id
|
||||||
// Required: false
|
// Required: false
|
||||||
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"`
|
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"`
|
||||||
@@ -96,7 +104,7 @@ type ListRequest struct {
|
|||||||
ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
|
ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
|
||||||
|
|
||||||
// Public Session ID
|
// 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
|
// List gets audit records for the specified account object
|
||||||
|
|||||||
@@ -43,6 +43,42 @@ type ItemAudit struct {
|
|||||||
|
|
||||||
// TTL
|
// TTL
|
||||||
TTL string `json:"_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
|
// List of audits
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -53,14 +54,14 @@ type AffinityRuleAddRequest struct {
|
|||||||
type wrapperAffinityRuleAddRequest struct {
|
type wrapperAffinityRuleAddRequest struct {
|
||||||
AffinityRuleAddRequest
|
AffinityRuleAddRequest
|
||||||
|
|
||||||
AsyncMode bool `url:"async_mode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AffinityRuleAdd adds affinity rule
|
// AffinityRuleAdd adds 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)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return AffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/compute/affinityRuleAdd"
|
url := "/cloudbroker/compute/affinityRuleAdd"
|
||||||
@@ -70,17 +71,24 @@ func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest
|
|||||||
AsyncMode: false,
|
AsyncMode: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return AffinityRuleAddResult{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !req.Migrate {
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseBool(string(res))
|
||||||
if err != nil {
|
return AffinityRuleAddResult{Ok: result}, err
|
||||||
return false, 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
|
// AsyncAffinityRuleAdd add affinity rule in async mode
|
||||||
@@ -97,7 +105,7 @@ func (c Compute) AsyncAffinityRuleAdd(ctx context.Context, req AffinityRuleAddRe
|
|||||||
AsyncMode: true,
|
AsyncMode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -51,14 +52,14 @@ type AntiAffinityRuleAddRequest struct {
|
|||||||
type wrapperAntiAffinityRuleAddRequest struct {
|
type wrapperAntiAffinityRuleAddRequest struct {
|
||||||
AntiAffinityRuleAddRequest
|
AntiAffinityRuleAddRequest
|
||||||
|
|
||||||
AsyncMode bool `url:"async_mode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiAffinityRuleAdd adds anti affinity rule
|
// AntiAffinityRuleAdd adds 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)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return AntiAffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/compute/antiAffinityRuleAdd"
|
url := "/cloudbroker/compute/antiAffinityRuleAdd"
|
||||||
@@ -68,17 +69,24 @@ func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAd
|
|||||||
AsyncMode: false,
|
AsyncMode: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return AntiAffinityRuleAddResult{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !req.Migrate {
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseBool(string(res))
|
||||||
if err != nil {
|
return AntiAffinityRuleAddResult{Ok: result}, err
|
||||||
return false, 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
|
// AsyncAntiAffinityRuleAdd add anti affinity rule in async mode
|
||||||
@@ -95,7 +103,7 @@ func (c Compute) AsyncAntiAffinityRuleAdd(ctx context.Context, req AntiAffinityR
|
|||||||
AsyncMode: true,
|
AsyncMode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ type wrapperDiskQOSRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DiskQOS changes QOS of the disk
|
// DiskQOS changes QOS of the disk
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error) {
|
func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
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
|
// 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) {
|
func (c Compute) DiskQOSAsync(ctx context.Context, req DiskQOSRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ type DiskSwitchToReplicationRequest struct {
|
|||||||
// Delete replication relationship
|
// Delete replication relationship
|
||||||
// Required: false
|
// Required: false
|
||||||
StopReplication bool `url:"stopReplication" json:"stopReplication"`
|
StopReplication bool `url:"stopReplication" json:"stopReplication"`
|
||||||
|
|
||||||
|
// Use planned failover for asynchronous replication
|
||||||
|
// Required: false
|
||||||
|
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type wrapperDiskSwitchToReplicationRequest struct {
|
type wrapperDiskSwitchToReplicationRequest struct {
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ type AsyncWrapperMigrateRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Migrate migrates compute to another node
|
// Migrate migrates compute to another node
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error) {
|
func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -50,6 +52,8 @@ func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AsyncMigrate migrates compute to another node in async mode
|
// AsyncMigrate migrates compute to another node in async mode
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) AsyncMigrate(ctx context.Context, req MigrateRequest) (string, error) {
|
func (c Compute) AsyncMigrate(ctx context.Context, req MigrateRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ type wrapperMigrateAbortRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateAbort aborts compute migration
|
// MigrateAbort aborts compute migration
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateAbort(ctx context.Context, req MigrateAbortRequest) (string, error) {
|
func (c Compute) MigrateAbort(ctx context.Context, req MigrateAbortRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -46,6 +48,8 @@ func (c Compute) MigrateAbort(ctx context.Context, req MigrateAbortRequest) (str
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateAbortAsync aborts compute migration with AsyncMode
|
// MigrateAbortAsync aborts compute migration with AsyncMode
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateAbortAsync(ctx context.Context, req MigrateAbortRequest) (string, error) {
|
func (c Compute) MigrateAbortAsync(ctx context.Context, req MigrateAbortRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package compute
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
@@ -25,17 +26,48 @@ type MigrateStorageRequest struct {
|
|||||||
// Target node ID
|
// Target node ID
|
||||||
// Required: true
|
// Required: true
|
||||||
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
// Async API call
|
type wrapperMigrateStorageRequest struct {
|
||||||
// Required: true
|
MigrateStorageRequest
|
||||||
Async interface{} `url:"async_mode" json:"async_mode" validate:"required,isBool"`
|
AsyncMode bool `url:"async_mode,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorage gets complex compute migration
|
// MigrateStorage gets complex compute migration
|
||||||
// Compute will be migrated to specified node, and compute disks will
|
// Compute will be migrated to specified node, and compute disks will
|
||||||
// be migrated to specified SEP to specified pool.
|
// be migrated to specified SEP to specified pool.
|
||||||
// This action can take up to 84 hours
|
// This action can take up to 84 hours
|
||||||
func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest) (string, error) {
|
func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrateStorage"
|
||||||
|
|
||||||
|
aReq := wrapperMigrateStorageRequest{
|
||||||
|
MigrateStorageRequest: req,
|
||||||
|
AsyncMode: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := c.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
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateStorageAsync gets complex compute migration in async mode
|
||||||
|
// Compute will be migrated to specified node, and compute disks will
|
||||||
|
// be migrated to specified SEP to specified pool.
|
||||||
|
// This action can take up to 84 hours
|
||||||
|
func (c Compute) MigrateStorageAsync(ctx context.Context, req MigrateStorageRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
@@ -43,7 +75,12 @@ func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest)
|
|||||||
|
|
||||||
url := "/cloudbroker/compute/migrateStorage"
|
url := "/cloudbroker/compute/migrateStorage"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
aReq := wrapperMigrateStorageRequest{
|
||||||
|
MigrateStorageRequest: req,
|
||||||
|
AsyncMode: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ type wrapperMigrateStorageAbortRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageAbort aborts complex compute migration job
|
// MigrateStorageAbort aborts complex compute migration job
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageAbort(ctx context.Context, req MigrateStorageAbortRequest) (bool, error) {
|
func (c Compute) MigrateStorageAbort(ctx context.Context, req MigrateStorageAbortRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -54,6 +56,8 @@ func (c Compute) MigrateStorageAbort(ctx context.Context, req MigrateStorageAbor
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageAbortAsync aborts complex compute migration job with AsyncMode
|
// MigrateStorageAbortAsync aborts complex compute migration job with AsyncMode
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageAbortAsync(ctx context.Context, req MigrateStorageAbortRequest) (string, error) {
|
func (c Compute) MigrateStorageAbortAsync(ctx context.Context, req MigrateStorageAbortRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ type wrapperMigrateStorageCleanUpRequest struct {
|
|||||||
// MigrateStorageCleanUp cleanup resources after finished (success of failed) complex compute migration.
|
// MigrateStorageCleanUp cleanup resources after finished (success of failed) complex compute migration.
|
||||||
// If the migration was successful, then old disks will be removed, else new (target) disks will be removed.
|
// If the migration was successful, then old disks will be removed, else new (target) disks will be removed.
|
||||||
// Do it wisely!
|
// Do it wisely!
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageCleanUp(ctx context.Context, req MigrateStorageCleanUpRequest) (bool, error) {
|
func (c Compute) MigrateStorageCleanUp(ctx context.Context, req MigrateStorageCleanUpRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -51,6 +53,8 @@ func (c Compute) MigrateStorageCleanUp(ctx context.Context, req MigrateStorageCl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageCleanUpAsync cleanup resources after finished migration with AsyncMode
|
// MigrateStorageCleanUpAsync cleanup resources after finished migration with AsyncMode
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageCleanUpAsync(ctx context.Context, req MigrateStorageCleanUpRequest) (string, error) {
|
func (c Compute) MigrateStorageCleanUpAsync(ctx context.Context, req MigrateStorageCleanUpRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ type MigrateStorageInfoRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageInfo gets info about last (include ongoing) storage migration
|
// MigrateStorageInfo gets info about last (include ongoing) storage migration
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageInfo(ctx context.Context, req MigrateStorageInfoRequest) (*RecordMigrateStorageInfo, error) {
|
func (c Compute) MigrateStorageInfo(ctx context.Context, req MigrateStorageInfoRequest) (*RecordMigrateStorageInfo, error) {
|
||||||
res, err := c.MigrateStorageInfoRaw(ctx, req)
|
res, err := c.MigrateStorageInfoRaw(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -33,6 +35,8 @@ func (c Compute) MigrateStorageInfo(ctx context.Context, req MigrateStorageInfoR
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageInfoRaw gets info about last (include ongoing) storage migration as an array of bytes
|
// MigrateStorageInfoRaw gets info about last (include ongoing) storage migration as an array of bytes
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageInfoRaw(ctx context.Context, req MigrateStorageInfoRequest) ([]byte, error) {
|
func (c Compute) MigrateStorageInfoRaw(ctx context.Context, req MigrateStorageInfoRequest) ([]byte, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ type MigrateStorageListRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageList gets list of the jobs.
|
// MigrateStorageList gets list of the jobs.
|
||||||
|
//
|
||||||
|
// Deprecated: will be removed in SDK v1.17
|
||||||
func (c Compute) MigrateStorageList(ctx context.Context, req MigrateStorageListRequest) (*ListMigrateStorage, error) {
|
func (c Compute) MigrateStorageList(ctx context.Context, req MigrateStorageListRequest) (*ListMigrateStorage, error) {
|
||||||
if err := validators.ValidateRequest(req); err != nil {
|
if err := validators.ValidateRequest(req); err != nil {
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Target describes a target for migration
|
||||||
|
type Target struct {
|
||||||
|
// SEP ID
|
||||||
|
// Required: true
|
||||||
|
SepID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
||||||
|
|
||||||
|
// Name of a pool
|
||||||
|
// Required: true
|
||||||
|
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
|
||||||
|
|
||||||
|
// Storage policy ID
|
||||||
|
// Required: false
|
||||||
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
|
// Disk IDs
|
||||||
|
// Required: false
|
||||||
|
DiskIDs []uint64 `url:"disk_ids,omitempty" json:"disk_ids,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Storage describes a destination for a disk
|
||||||
|
type Storage struct {
|
||||||
|
// Target for migration
|
||||||
|
// Required: false
|
||||||
|
Targets []Target `url:"targets,omitempty" json:"targets,omitempty"`
|
||||||
|
|
||||||
|
// Whether a separate source-disk cleanup job should be started after full success
|
||||||
|
// Required: false
|
||||||
|
AutoCleanup interface{} `url:"auto_cleanup,omitempty" json:"auto_cleanup,omitempty" validate:"omitempty,isBool"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2Request to start a migration of a compute or a disk
|
||||||
|
type MigrateV2Request struct {
|
||||||
|
// ID of compute to migrate
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
||||||
|
|
||||||
|
// Stateless load balancers support only compute mode, including their local system disk.
|
||||||
|
// Required: false
|
||||||
|
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,migrateV2Mode"`
|
||||||
|
|
||||||
|
// ID of node to migrate to
|
||||||
|
// Required: false
|
||||||
|
TargetNodeID uint64 `url:"target_node_id,omitempty" json:"target_node_id,omitempty"`
|
||||||
|
|
||||||
|
// Destination for a disk
|
||||||
|
// Required: false
|
||||||
|
Storage Storage `url:"storage,omitempty" json:"storage,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2 starts a migration of a compute or a disk
|
||||||
|
func (c Compute) MigrateV2(ctx context.Context, req MigrateV2Request) (string, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrate_v2"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
var resp string
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &resp)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MigrateV2AbortRequest to abort a migration of a compute
|
||||||
|
type MigrateV2AbortRequest struct {
|
||||||
|
// Original migration workflow IDs, not agent, cleanup or recovery job IDs
|
||||||
|
// Required: true
|
||||||
|
WorkflowJobIDs []string `url:"workflow_job_ids" json:"workflow_job_ids" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2Abort aborts a migration of a compute
|
||||||
|
func (c Compute) MigrateV2Abort(ctx context.Context, req MigrateV2AbortRequest) (*MigrateV2AbortRecord, error) {
|
||||||
|
res, err := c.MigrateV2AbortRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := MigrateV2AbortRecord{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2AbortRaw aborts a migration of a compute and returns an array of bytes
|
||||||
|
func (c Compute) MigrateV2AbortRaw(ctx context.Context, req MigrateV2AbortRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrate_v2_abort"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MigrateV2CleanupRequest to clean up after a migration of a compute
|
||||||
|
type MigrateV2CleanupRequest struct {
|
||||||
|
// Original migration workflow IDs, not agent, cleanup or recovery job IDs
|
||||||
|
// Required: true
|
||||||
|
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2Cleanup cleans up after a migration of a compute
|
||||||
|
func (c Compute) MigrateV2Cleanup(ctx context.Context, req MigrateV2CleanupRequest) (string, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrate_v2_cleanup"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
var resp string
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &resp)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MigrateV2GetRequest to get the information about a workflow job
|
||||||
|
type MigrateV2GetRequest struct {
|
||||||
|
// Original migration workflow IDs
|
||||||
|
// Required: true
|
||||||
|
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2Get gets information about a workflow job as a MigrateV2Record struct
|
||||||
|
func (c Compute) MigrateV2Get(ctx context.Context, req MigrateV2GetRequest) (*MigrateV2Record, error) {
|
||||||
|
res, err := c.MigrateV2GetRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := MigrateV2Record{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about a workflow job as an array of bytes
|
||||||
|
func (c Compute) MigrateV2GetRaw(ctx context.Context, req MigrateV2GetRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrate_v2_get"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MigrateV2ListRequest to list migrations
|
||||||
|
type MigrateV2ListRequest struct {
|
||||||
|
// Exact APIServer migration workflow job ID
|
||||||
|
// Required: false
|
||||||
|
WorkflowJobID string `url:"workflow_job_id,omitempty" json:"workflow_job_id,omitempty"`
|
||||||
|
|
||||||
|
// Compute ID
|
||||||
|
// Required: false
|
||||||
|
ComputeID uint64 `url:"compute_id,omitempty" json:"compute_id,omitempty"`
|
||||||
|
|
||||||
|
// Exact business migration status
|
||||||
|
// Required: false
|
||||||
|
Status string `url:"status,omitempty" json:"status,omitempty"`
|
||||||
|
|
||||||
|
// Source node ID
|
||||||
|
// Required: false
|
||||||
|
SourceNodeID uint64 `url:"source_node_id,omitempty" json:"source_node_id,omitempty"`
|
||||||
|
|
||||||
|
// Target node ID
|
||||||
|
// Required: false
|
||||||
|
TargetNodeID uint64 `url:"target_node_id,omitempty" json:"target_node_id,omitempty"`
|
||||||
|
|
||||||
|
// Whether retained source disks still require cleanup
|
||||||
|
// Required: false
|
||||||
|
CleanupRequired interface{} `url:"cleanup_required,omitempty" json:"cleanup_required,omitempty" validate:"omitempty,isBool"`
|
||||||
|
|
||||||
|
// Page number
|
||||||
|
// Required: false
|
||||||
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|
||||||
|
// Page size
|
||||||
|
// Required: false
|
||||||
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2List gets list of the jobs
|
||||||
|
func (c Compute) MigrateV2List(ctx context.Context, req MigrateV2ListRequest) (*ListMigrateV2, error) {
|
||||||
|
if err := validators.ValidateRequest(req); err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrate_v2_list"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
list := ListMigrateV2{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &list)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &list, nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MigrateResolveRequest to resolve a migration
|
||||||
|
type MigrateV2ResolveRequest struct {
|
||||||
|
// Workflow job ID
|
||||||
|
// Required: true
|
||||||
|
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
|
||||||
|
|
||||||
|
// Take over cleanup
|
||||||
|
// Required: false
|
||||||
|
TakeOverCleanup interface{} `url:"take_over_cleanup,omitempty" json:"take_over_cleanup,omitempty" validate:"omitempty,isBool"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2Resolve resolves a migration of a compute
|
||||||
|
func (c Compute) MigrateV2Resolve(ctx context.Context, req MigrateV2ResolveRequest) (*MigrateV2ResolveRecord, error) {
|
||||||
|
res, err := c.MigrateV2ResolveRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := MigrateV2ResolveRecord{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2ResolveRaw resolves a migration of a compute and returns an array of bytes
|
||||||
|
func (c Compute) MigrateV2ResolveRaw(ctx context.Context, req MigrateV2ResolveRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/migrate_v2_resolve"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
@@ -424,6 +424,9 @@ type ItemDisk struct {
|
|||||||
// Created time
|
// Created time
|
||||||
CreatedTime uint64 `json:"createdTime"`
|
CreatedTime uint64 `json:"createdTime"`
|
||||||
|
|
||||||
|
// Whether CRT tracking is enabled
|
||||||
|
CRTTracking bool `json:"crt_tracking"`
|
||||||
|
|
||||||
// Device name
|
// Device name
|
||||||
DeviceName string `json:"devicename"`
|
DeviceName string `json:"devicename"`
|
||||||
|
|
||||||
@@ -938,6 +941,9 @@ type InfoCompute struct {
|
|||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
|
// Folder ID
|
||||||
|
FolderID uint64 `json:"folder_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type QemuQuest struct {
|
type QemuQuest struct {
|
||||||
@@ -1252,6 +1258,9 @@ type RecordCompute struct {
|
|||||||
|
|
||||||
//todo
|
//todo
|
||||||
_ uint64 `json:"nodeId"`
|
_ uint64 `json:"nodeId"`
|
||||||
|
|
||||||
|
// Folder ID
|
||||||
|
FolderID uint64 `json:"folder_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detailed information about ACL Access in a compute
|
// Detailed information about ACL Access in a compute
|
||||||
@@ -2272,3 +2281,376 @@ type CheckComputePlacementItem struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CheckComputePlacementResult map[uint64]CheckComputePlacementItem
|
type CheckComputePlacementResult map[uint64]CheckComputePlacementItem
|
||||||
|
|
||||||
|
type Result struct {
|
||||||
|
// Workflow ID
|
||||||
|
WorkflowJobID string `json:"workflow_job_id"`
|
||||||
|
|
||||||
|
// Compute ID
|
||||||
|
ComputeID uint64 `json:"compute_id"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Job ID
|
||||||
|
JobID string `json:"job_id"`
|
||||||
|
|
||||||
|
// Message
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateV2 abort record
|
||||||
|
type MigrateV2AbortRecord struct {
|
||||||
|
// Results
|
||||||
|
Results []Result `json:"results"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Origin struct {
|
||||||
|
// Type
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
|
// Correlation ID
|
||||||
|
CorrelationID string `json:"correlation_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Observation struct {
|
||||||
|
// Updated at
|
||||||
|
UpdatedAt uint64 `json:"updated_at"`
|
||||||
|
|
||||||
|
// Agent job ID
|
||||||
|
AgentJobID string `json:"agent_job_id"`
|
||||||
|
|
||||||
|
// Attempt
|
||||||
|
Attempt uint64 `json:"attempt"`
|
||||||
|
|
||||||
|
// Operation
|
||||||
|
Operation string `json:"operation"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Memory struct {
|
||||||
|
// Sampled at
|
||||||
|
SampledAt uint64 `json:"sampled_at"`
|
||||||
|
|
||||||
|
// Percent
|
||||||
|
Percent uint64 `json:"percent"`
|
||||||
|
|
||||||
|
// Bytes per second
|
||||||
|
BytesPerSecond uint64 `json:"bytes_per_second"`
|
||||||
|
|
||||||
|
// Processed bytes
|
||||||
|
ProcessedBytes uint64 `json:"processed_bytes"`
|
||||||
|
|
||||||
|
// Remaining bytes
|
||||||
|
RemainingBytes uint64 `json:"remaining_bytes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProgressDisks struct {
|
||||||
|
// Scope
|
||||||
|
Scope string `json:"scope"`
|
||||||
|
|
||||||
|
// Target devs
|
||||||
|
TargetDevs []string `json:"target_devs"`
|
||||||
|
|
||||||
|
// Sampled at
|
||||||
|
SampledAt uint64 `json:"sampled_at"`
|
||||||
|
|
||||||
|
// Percent
|
||||||
|
Percent uint64 `json:"percent"`
|
||||||
|
|
||||||
|
// Bytes per second
|
||||||
|
BytesPerSecond uint64 `json:"bytes_per_second"`
|
||||||
|
|
||||||
|
// Processed bytes
|
||||||
|
ProcessedBytes uint64 `json:"processed_bytes"`
|
||||||
|
|
||||||
|
// Remaining bytes
|
||||||
|
RemainingBytes uint64 `json:"remaining_bytes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SystemDisk struct {
|
||||||
|
// Target dev
|
||||||
|
TargetDev string `json:"target_dev"`
|
||||||
|
|
||||||
|
// Sampled at
|
||||||
|
SampledAt uint64 `json:"sampled_at"`
|
||||||
|
|
||||||
|
// Percent
|
||||||
|
Percent uint64 `json:"percent"`
|
||||||
|
|
||||||
|
// Bytes per second
|
||||||
|
BytesPerSecond uint64 `json:"bytes_per_second"`
|
||||||
|
|
||||||
|
// Processed bytes
|
||||||
|
ProcessedBytes uint64 `json:"processed_bytes"`
|
||||||
|
|
||||||
|
// Remaining bytes
|
||||||
|
RemainingBytes uint64 `json:"remaining_bytes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Progress struct {
|
||||||
|
// Observation
|
||||||
|
Observation Observation `json:"observation"`
|
||||||
|
|
||||||
|
// Memory
|
||||||
|
Memory Memory `json:"memory"`
|
||||||
|
|
||||||
|
// Disks
|
||||||
|
Disks ProgressDisks `json:"disks"`
|
||||||
|
|
||||||
|
// System disk
|
||||||
|
SystemDisk SystemDisk `json:"system_disk"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Disk struct {
|
||||||
|
// Source disk ID
|
||||||
|
SourceDiskID uint64 `json:"source_disk_id"`
|
||||||
|
|
||||||
|
// Target disk ID
|
||||||
|
TargetDiskID uint64 `json:"target_disk_id"`
|
||||||
|
|
||||||
|
// Target dev
|
||||||
|
TargetDev string `json:"target_dev"`
|
||||||
|
|
||||||
|
// SEP ID
|
||||||
|
SEPID uint64 `json:"sep_id"`
|
||||||
|
|
||||||
|
// Pool name
|
||||||
|
PoolName string `json:"pool_name"`
|
||||||
|
|
||||||
|
// Storage policy ID
|
||||||
|
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||||
|
|
||||||
|
// State
|
||||||
|
State string `json:"state"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Cleanup struct {
|
||||||
|
// Job ID
|
||||||
|
JobID string `json:"job_id"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Error
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Resolution struct {
|
||||||
|
// Resolved at
|
||||||
|
ResolvedAt string `json:"resolved_at"`
|
||||||
|
|
||||||
|
// Resolved by
|
||||||
|
ResolvedBy string `json:"resolved_by"`
|
||||||
|
|
||||||
|
// RequestID
|
||||||
|
RequestId string `json:"request_id"`
|
||||||
|
|
||||||
|
// Take over cleanup
|
||||||
|
TakeOverCleanup bool `json:"take_over_cleanup"`
|
||||||
|
|
||||||
|
// Previous status
|
||||||
|
PreviousStatus string `json:"previous_status"`
|
||||||
|
|
||||||
|
// Previous cleanup required
|
||||||
|
PreviousCleanupRequired bool `json:"previous_cleanup_required"`
|
||||||
|
|
||||||
|
// Previous error
|
||||||
|
PreviousError string `json:"previous_error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MigrateV2Item struct {
|
||||||
|
// Workflow Job ID
|
||||||
|
WorkflowJobID string `json:"workflow_job_id"`
|
||||||
|
|
||||||
|
// Mode
|
||||||
|
Mode string `json:"mode"`
|
||||||
|
|
||||||
|
// Origin
|
||||||
|
Origin Origin `json:"origin"`
|
||||||
|
|
||||||
|
// Compute ID
|
||||||
|
ComputeID uint64 `json:"compute_id"`
|
||||||
|
|
||||||
|
// Progress
|
||||||
|
Progress Progress `json:"progress"`
|
||||||
|
|
||||||
|
// Domain name
|
||||||
|
DomainName string `json:"domain_name"`
|
||||||
|
|
||||||
|
// Domain UUID
|
||||||
|
DomainUUID string `json:"domain_uuid"`
|
||||||
|
|
||||||
|
// Source node ID
|
||||||
|
SourceNodeID uint64 `json:"source_node_id"`
|
||||||
|
|
||||||
|
// Target node ID
|
||||||
|
TargetNodeID uint64 `json:"target_node_id"`
|
||||||
|
|
||||||
|
// Source tech status
|
||||||
|
SourceTechStatus string `json:"source_tech_status"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Migration result confirmed
|
||||||
|
MigrationResultConfirmed bool `json:"migration_result_confirmed"`
|
||||||
|
|
||||||
|
// Disks
|
||||||
|
Disks []Disk `json:"disks"`
|
||||||
|
|
||||||
|
// Disk IDs not copied
|
||||||
|
DiskIDsNotCopied []uint64 `json:"disk_ids_not_copied"`
|
||||||
|
|
||||||
|
// Error
|
||||||
|
Error string `json:"error"`
|
||||||
|
|
||||||
|
// Cleanup required
|
||||||
|
CleanupRequired bool `json:"cleanup_required"`
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
Cleanup Cleanup `json:"cleanup"`
|
||||||
|
|
||||||
|
// Resolution
|
||||||
|
Resolution Resolution `json:"resolution"`
|
||||||
|
|
||||||
|
// Created at
|
||||||
|
CreatedAt string `json:"created_at"`
|
||||||
|
|
||||||
|
// Updated at
|
||||||
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListMigrateV2 struct {
|
||||||
|
// Entry count
|
||||||
|
EntryCount uint64 `json:"entry_count"`
|
||||||
|
|
||||||
|
// Data
|
||||||
|
Data []MigrateV2Item `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MigrateV2Record struct {
|
||||||
|
// Workflow Job ID
|
||||||
|
WorkflowJobID string `json:"workflow_job_id"`
|
||||||
|
|
||||||
|
// Mode
|
||||||
|
Mode string `json:"mode"`
|
||||||
|
|
||||||
|
// Origin
|
||||||
|
Origin Origin `json:"origin"`
|
||||||
|
|
||||||
|
// Compute ID
|
||||||
|
ComputeID uint64 `json:"compute_id"`
|
||||||
|
|
||||||
|
// Progress
|
||||||
|
Progress Progress `json:"progress"`
|
||||||
|
|
||||||
|
// Domain name
|
||||||
|
DomainName string `json:"domain_name"`
|
||||||
|
|
||||||
|
// Domain UUID
|
||||||
|
DomainUUID string `json:"domain_uuid"`
|
||||||
|
|
||||||
|
// Source node ID
|
||||||
|
SourceNodeID uint64 `json:"source_node_id"`
|
||||||
|
|
||||||
|
// Target node ID
|
||||||
|
TargetNodeID uint64 `json:"target_node_id"`
|
||||||
|
|
||||||
|
// Source tech status
|
||||||
|
SourceTechStatus string `json:"source_tech_status"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Migration result confirmed
|
||||||
|
MigrationResultConfirmed bool `json:"migration_result_confirmed"`
|
||||||
|
|
||||||
|
// Disks
|
||||||
|
Disks []Disk `json:"disks"`
|
||||||
|
|
||||||
|
// Disk IDs not copied
|
||||||
|
DiskIDsNotCopied []uint64 `json:"disk_ids_not_copied"`
|
||||||
|
|
||||||
|
// Error
|
||||||
|
Error string `json:"error"`
|
||||||
|
|
||||||
|
// Cleanup required
|
||||||
|
CleanupRequired bool `json:"cleanup_required"`
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
Cleanup Cleanup `json:"cleanup"`
|
||||||
|
|
||||||
|
// Resolution
|
||||||
|
Resolution Resolution `json:"resolution"`
|
||||||
|
|
||||||
|
// Created at
|
||||||
|
CreatedAt string `json:"created_at"`
|
||||||
|
|
||||||
|
// Updated at
|
||||||
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
|
||||||
|
// Logs
|
||||||
|
Logs []string `json:"logs"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Migrate V2 resolve record
|
||||||
|
type MigrateV2ResolveRecord struct {
|
||||||
|
// Workflow job ID
|
||||||
|
WorkflowJobID string `json:"workflow_job_id"`
|
||||||
|
|
||||||
|
// Compute ID
|
||||||
|
ComputeID uint64 `json:"compute_id"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Cleanup required
|
||||||
|
CleanupRequired bool `json:"cleanup_required"`
|
||||||
|
|
||||||
|
// Resolution
|
||||||
|
Resolution Resolution `json:"resolution"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -18,15 +18,11 @@ type SnapshotEvictDiskRequest struct {
|
|||||||
// ID of the disk instance
|
// ID of the disk instance
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
|
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
|
||||||
|
|
||||||
// Is mode async
|
|
||||||
// Required: false
|
|
||||||
AsyncMode interface{} `url:"async_mode,omitempty" json:"async_mode,omitempty" validate:"omitempty,isBool"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type asyncWrapperSnapshotEvictDiskRequest struct {
|
type asyncWrapperSnapshotEvictDiskRequest struct {
|
||||||
SnapshotEvictDiskRequest
|
SnapshotEvictDiskRequest
|
||||||
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
|
AsyncMode bool `url:"async_mode,omitempty" json:"async_mode,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SnapshotEvictDisk evicts specified disk from all snapshots of a compute instance
|
// SnapshotEvictDisk evicts specified disk from all snapshots of a compute instance
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ type UpdateRequest struct {
|
|||||||
|
|
||||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
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 account
|
// ID of the storage policy to which to connect account
|
||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
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 {
|
type wrapperChangeDiskStoragePolicyRequest struct {
|
||||||
|
|||||||
@@ -67,6 +67,30 @@ type LimitIORequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
WriteIOPSSecMax uint64 `url:"write_iops_sec_max,omitempty" json:"write_iops_sec_max,omitempty"`
|
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
|
// SizeIOPSSec
|
||||||
// Required: false
|
// Required: false
|
||||||
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
|
SizeIOPSSec uint64 `url:"size_iops_sec,omitempty" json:"size_iops_sec,omitempty"`
|
||||||
|
|||||||
@@ -199,6 +199,9 @@ type InfoDisk struct {
|
|||||||
|
|
||||||
// Cache mode of disk
|
// Cache mode of disk
|
||||||
Cache string `json:"cache"`
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
|
// Whether CRT is tracked
|
||||||
|
CRTTracking bool `json:"crt_tracking"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemReplication struct {
|
type ItemReplication struct {
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ type ReplicateRequest struct {
|
|||||||
// ID of the storage policy under the disk will be created
|
// ID of the storage policy under the disk will be created
|
||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
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 {
|
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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReplicationDisableSchedule 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 := "/cloudbroker/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,46 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ReplicationEnableScheduleRequest to apply a replication profile schedule to an asynchronous replication pair
|
||||||
|
type ReplicationEnableScheduleRequest 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"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReplicationEnableSchedule applies a replication profile schedule to an asynchronous replication pair
|
||||||
|
func (d Disks) ReplicationEnableSchedule(ctx context.Context, req ReplicationEnableScheduleRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/disks/replication_enable_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,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 := "/cloudbroker/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 := "/cloudbroker/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,11 @@ type ReplicationReverseRequest struct {
|
|||||||
// Id of the disk
|
// Id of the disk
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
|
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
|
||||||
|
|
||||||
|
// Use planned failover for asynchronous replication
|
||||||
|
// Required: false
|
||||||
|
// Default: true
|
||||||
|
Planned interface{} `url:"planned,omitempty" json:"planned,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type wrapperReplicationReverseRequest struct {
|
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 := "/cloudbroker/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
|
||||||
|
}
|
||||||
@@ -18,6 +18,14 @@ type ReplicationStartRequest struct {
|
|||||||
// ID of target disk. Secondary disk in replication
|
// ID of target disk. Secondary disk in replication
|
||||||
// Required: true
|
// Required: true
|
||||||
TargetDiskID uint64 `url:"targetDiskId" json:"targetDiskId" validate:"required"`
|
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 {
|
type wrapperReplicationStartRequest struct {
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ReplicationSyncNowRequest to start manual synchronization of an asynchronous replication pair
|
||||||
|
type ReplicationSyncNowRequest struct {
|
||||||
|
// Disk ID
|
||||||
|
// Required: true
|
||||||
|
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReplicationSyncNow starts manual synchronization of an asynchronous replication pair
|
||||||
|
func (d Disks) ReplicationSyncNow(ctx context.Context, req ReplicationSyncNowRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/disks/replication_sync_now"
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package extnet
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -15,6 +16,11 @@ type EnableRequest struct {
|
|||||||
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
|
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type asyncWrapperEnableRequest struct {
|
||||||
|
EnableRequest
|
||||||
|
AsyncMode bool `url:"async_mode"`
|
||||||
|
}
|
||||||
|
|
||||||
// Enable enables external networks
|
// Enable enables external networks
|
||||||
func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -24,7 +30,12 @@ func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
|||||||
|
|
||||||
url := "/cloudbroker/extnet/enable"
|
url := "/cloudbroker/extnet/enable"
|
||||||
|
|
||||||
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
aReq := asyncWrapperEnableRequest{
|
||||||
|
EnableRequest: req,
|
||||||
|
AsyncMode: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
@@ -36,3 +47,32 @@ func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
|||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EnableAsync enables external networks in async mode
|
||||||
|
func (e ExtNet) EnableAsync(ctx context.Context, req EnableRequest) (string, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/extnet/enable"
|
||||||
|
|
||||||
|
aReq := asyncWrapperEnableRequest{
|
||||||
|
EnableRequest: req,
|
||||||
|
AsyncMode: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := e.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
|
||||||
|
}
|
||||||
@@ -20,12 +20,21 @@ type ItemReservation struct {
|
|||||||
// Account ID
|
// Account ID
|
||||||
AccountID uint64 `json:"account_id"`
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
|
// Auto assignable
|
||||||
|
AutoAssignable bool `json:"auto_assignable"`
|
||||||
|
|
||||||
// Client type
|
// Client type
|
||||||
ClientType string `json:"clientType"`
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
Description string `json:"desc"`
|
Description string `json:"desc"`
|
||||||
|
|
||||||
|
// Domain name
|
||||||
|
DomainName string `json:"domainname"`
|
||||||
|
|
||||||
|
// Hostname
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
|
||||||
// IP
|
// IP
|
||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
|
|
||||||
@@ -37,12 +46,6 @@ type ItemReservation struct {
|
|||||||
|
|
||||||
// Virtual machine ID
|
// Virtual machine ID
|
||||||
VMID uint64 `json:"vmId"`
|
VMID uint64 `json:"vmId"`
|
||||||
|
|
||||||
// Domain name
|
|
||||||
DomainName string `json:"domainname"`
|
|
||||||
|
|
||||||
// Hostname
|
|
||||||
Hostname string `json:"hostname"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// List reservations
|
// List reservations
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ type RecordGrid struct {
|
|||||||
|
|
||||||
// Budget
|
// Budget
|
||||||
Budget bool `json:"budget"`
|
Budget bool `json:"budget"`
|
||||||
|
|
||||||
|
// Whether VM folders are enabled
|
||||||
|
VMFoldersEnabled bool `json:"vm_folders_enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about grid
|
// Information about grid
|
||||||
@@ -165,6 +168,9 @@ type ItemGridList struct {
|
|||||||
|
|
||||||
// Budget
|
// Budget
|
||||||
Budget bool `json:"budget"`
|
Budget bool `json:"budget"`
|
||||||
|
|
||||||
|
// Whether VM folders are enabled
|
||||||
|
VMFoldersEnabled bool `json:"vm_folders_enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List Grids
|
// List Grids
|
||||||
|
|||||||
@@ -240,6 +240,10 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
|
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
|
// Zone ID
|
||||||
// Required: false
|
// Required: false
|
||||||
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
||||||
@@ -273,8 +277,12 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
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
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ type CreateBlankRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
|
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
|
// VM type linux, windows or unknown
|
||||||
// Required: false
|
// Required: false
|
||||||
LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"`
|
LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"`
|
||||||
@@ -145,8 +149,12 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
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
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ type MassCreateRequest struct {
|
|||||||
|
|
||||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||||
// Required: false
|
// Required: false
|
||||||
// Default: "auto"
|
// Default: none
|
||||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ type EnableRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||||
|
|
||||||
// Message
|
|
||||||
// Required: false
|
|
||||||
Message string `url:"message,omitempty" json:"message,omitempty"`
|
|
||||||
|
|
||||||
// Do not check locks, iscsi-sessions or disk-present
|
// Do not check locks, iscsi-sessions or disk-present
|
||||||
// Default: false
|
// Default: false
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -340,6 +340,9 @@ type ItemNode struct {
|
|||||||
|
|
||||||
// PCI devices attached to the node
|
// PCI devices attached to the node
|
||||||
PCIDevices []ItemPCIDevice `json:"pci_devices"`
|
PCIDevices []ItemPCIDevice `json:"pci_devices"`
|
||||||
|
|
||||||
|
// Shared locks
|
||||||
|
SharedLocks map[string]interface{} `json:"shared_locks"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PackageInfo struct {
|
type PackageInfo struct {
|
||||||
@@ -429,6 +432,12 @@ type ItemNicInfo struct {
|
|||||||
|
|
||||||
// VFList
|
// VFList
|
||||||
VFList []interface{} `json:"vflist"`
|
VFList []interface{} `json:"vflist"`
|
||||||
|
|
||||||
|
// Link state
|
||||||
|
LinkState string `json:"linkState"`
|
||||||
|
|
||||||
|
// Link speed
|
||||||
|
LinkSpeed int64 `json:"linkSpeed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListNetAddr []ItemNetAddr
|
type ListNetAddr []ItemNetAddr
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package node
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RemoveSSHIdentityRequest to remove an ssh identity from a node
|
||||||
|
type RemoveSSHIdentityRequest struct {
|
||||||
|
// Node ID
|
||||||
|
// Required: true
|
||||||
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
|
||||||
|
// Key to remove
|
||||||
|
// Required: true
|
||||||
|
ClientPublicKey string `url:"client_public_key" json:"client_public_key" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveSSHIdentity removes an ssh identity from a node
|
||||||
|
func (n Node) RemoveSSHIdentity(ctx context.Context, req RemoveSSHIdentityRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/node/remove_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
|
||||||
|
}
|
||||||
@@ -34,6 +34,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
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
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type AddPoolRequest struct {
|
|||||||
|
|
||||||
type wrapperAddPoolRequest struct {
|
type wrapperAddPoolRequest struct {
|
||||||
AddPoolRequest
|
AddPoolRequest
|
||||||
AsyncMode bool `url:"asyncMode"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddPool adds pool to SEP in sync mode.
|
// AddPool adds pool to SEP in sync mode.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ type SharedLockStartRequest struct {
|
|||||||
type wrapperSharedLockStartRequest struct {
|
type wrapperSharedLockStartRequest struct {
|
||||||
SharedLockStartRequest
|
SharedLockStartRequest
|
||||||
|
|
||||||
AsyncMode bool `url:"sync"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SharedLockStart start shared locks without AsyncMode
|
// SharedLockStart start shared locks without AsyncMode
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type SharedLockStopRequest struct {
|
|||||||
type wrapperSharedLockStopRequest struct {
|
type wrapperSharedLockStopRequest struct {
|
||||||
SharedLockStopRequest
|
SharedLockStopRequest
|
||||||
|
|
||||||
AsyncMode bool `url:"sync"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SharedLockStop stop shared locks without AsyncMode
|
// SharedLockStop stop shared locks without AsyncMode
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ type ListRequest struct {
|
|||||||
Sub string `url:"sub,omitempty" json:"sub,omitempty"`
|
Sub string `url:"sub,omitempty" json:"sub,omitempty"`
|
||||||
|
|
||||||
// Filter by sid from JWT
|
// Filter by sid from JWT
|
||||||
SID uint64 `url:"sid,omitempty" json:"sid,omitempty"`
|
SID string `url:"sid,omitempty" json:"sid,omitempty"`
|
||||||
|
|
||||||
// Filter sessions with login_time >= timestamp (Unix timestamp)
|
// Filter sessions with login_time >= timestamp (Unix timestamp)
|
||||||
TimestampAt uint64 `url:"timestamp_at,omitempty" json:"timestamp_at,omitempty"`
|
TimestampAt uint64 `url:"timestamp_at,omitempty" json:"timestamp_at,omitempty"`
|
||||||
@@ -48,7 +48,7 @@ type ListRequest struct {
|
|||||||
|
|
||||||
// Sort by one of supported fields, format +|-(field)
|
// Sort by one of supported fields, format +|-(field)
|
||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty"`
|
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list of sessions as a ListSession struct
|
// List gets list of sessions as a ListSession struct
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ type CreateRequest struct {
|
|||||||
// one of: bvs, decs3o
|
// one of: bvs, decs3o
|
||||||
// Required: false
|
// Required: false
|
||||||
Provider string `url:"provider,omitempty" json:"provider,omitempty" validate:"omitempty,userProvider"`
|
Provider string `url:"provider,omitempty" json:"provider,omitempty" validate:"omitempty,userProvider"`
|
||||||
|
|
||||||
|
// Whether we create a service account
|
||||||
|
// Default value: false
|
||||||
|
// Required: false
|
||||||
|
ServiceAccount interface{} `url:"serviceaccount,omitempty" json:"serviceaccount,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a user.
|
// Create creates a user.
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
||||||
|
|
||||||
|
// API access ID
|
||||||
|
// Required: false
|
||||||
|
APIAccessID uint64 `url:"apiaccess_id,omitempty" json:"apiaccess_id,omitempty"`
|
||||||
|
|
||||||
// Page number.
|
// Page number.
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package user
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateServiceAccountRequest to update ServiceAccount field
|
||||||
|
type UpdateServiceAccountRequest struct {
|
||||||
|
// User ID
|
||||||
|
// Required: true
|
||||||
|
UserID string `url:"user_id" json:"user_id" validate:"required"`
|
||||||
|
|
||||||
|
// Whether the account is a service account
|
||||||
|
// Required: true
|
||||||
|
ServiceAccount interface{} `url:"serviceaccount" json:"serviceaccount" validate:"required,isBool"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateServiceAccount updates ServiceAccount field
|
||||||
|
func (u User) UpdateServiceAccount(ctx context.Context, req UpdateServiceAccountRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/user/update_service_account"
|
||||||
|
|
||||||
|
res, err := u.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
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package vgpu
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -14,6 +15,10 @@ type CreateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
PGPUID uint64 `url:"pgpu_id" json:"pgpu_id" validate:"required"`
|
PGPUID uint64 `url:"pgpu_id" json:"pgpu_id" validate:"required"`
|
||||||
|
|
||||||
|
// Name
|
||||||
|
// Required: true
|
||||||
|
Name string `url:"name" json:"name" validate:"required"`
|
||||||
|
|
||||||
// Virtual profile id
|
// Virtual profile id
|
||||||
// Required: false
|
// Required: false
|
||||||
ProfileID string `url:"profile_id,omitempty" json:"profile_id,omitempty"`
|
ProfileID string `url:"profile_id,omitempty" json:"profile_id,omitempty"`
|
||||||
@@ -31,6 +36,11 @@ type CreateRequest struct {
|
|||||||
AccountIDs []uint64 `url:"account_ids,omitempty" json:"account_ids,omitempty"`
|
AccountIDs []uint64 `url:"account_ids,omitempty" json:"account_ids,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type asyncWrapperCreateRequest struct {
|
||||||
|
CreateRequest
|
||||||
|
AsyncMode bool `url:"async_mode"`
|
||||||
|
}
|
||||||
|
|
||||||
// Create creates VGPU
|
// Create creates VGPU
|
||||||
func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -40,7 +50,12 @@ func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|||||||
|
|
||||||
url := "/cloudbroker/vgpu/create"
|
url := "/cloudbroker/vgpu/create"
|
||||||
|
|
||||||
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
aReq := asyncWrapperCreateRequest{
|
||||||
|
CreateRequest: req,
|
||||||
|
AsyncMode: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -52,3 +67,33 @@ func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateAsync creates VGPU in async mode
|
||||||
|
func (v VGPU) CreateAsync(ctx context.Context, req CreateRequest) (string, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/vgpu/create"
|
||||||
|
|
||||||
|
aReq := asyncWrapperCreateRequest{
|
||||||
|
CreateRequest: req,
|
||||||
|
AsyncMode: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := v.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
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package vgpu
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -15,6 +16,11 @@ type DestroyRequest struct {
|
|||||||
VGPUID uint64 `url:"vgpu_id" json:"vgpu_id" validate:"required"`
|
VGPUID uint64 `url:"vgpu_id" json:"vgpu_id" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type asyncWrapperDestroyRequest struct {
|
||||||
|
DestroyRequest
|
||||||
|
AsyncMode bool `url:"async_mode"`
|
||||||
|
}
|
||||||
|
|
||||||
// Destroy destroys VGPU
|
// Destroy destroys VGPU
|
||||||
func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error) {
|
func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -24,7 +30,12 @@ func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error) {
|
|||||||
|
|
||||||
url := "/cloudbroker/vgpu/destroy"
|
url := "/cloudbroker/vgpu/destroy"
|
||||||
|
|
||||||
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
aReq := asyncWrapperDestroyRequest{
|
||||||
|
DestroyRequest: req,
|
||||||
|
AsyncMode: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
@@ -36,3 +47,32 @@ func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error) {
|
|||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Destroy destroys VGPU in async mode
|
||||||
|
func (v VGPU) DestroyAsync(ctx context.Context, req DestroyRequest) (string, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/vgpu/destroy"
|
||||||
|
|
||||||
|
aReq := asyncWrapperDestroyRequest{
|
||||||
|
DestroyRequest: req,
|
||||||
|
AsyncMode: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := v.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
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package vgpu
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EditRequest to edit the name
|
||||||
|
type EditRequest struct {
|
||||||
|
// VGPU ID
|
||||||
|
// Required: true
|
||||||
|
VGPUID uint64 `url:"vgpu_id" json:"vgpu_id" validate:"required"`
|
||||||
|
|
||||||
|
// New name
|
||||||
|
// Required: false
|
||||||
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type asyncWrapperEditRequest struct {
|
||||||
|
EditRequest
|
||||||
|
AsyncMode bool `url:"async_mode"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit edits the name
|
||||||
|
func (v VGPU) Edit(ctx context.Context, req EditRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/vgpu/edit"
|
||||||
|
|
||||||
|
aReq := asyncWrapperEditRequest{
|
||||||
|
EditRequest: req,
|
||||||
|
AsyncMode: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := v.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
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit Async edits the name in async mode
|
||||||
|
func (v VGPU) EditAsync(ctx context.Context, req EditRequest) (string, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/vgpu/edit"
|
||||||
|
|
||||||
|
aReq := asyncWrapperEditRequest{
|
||||||
|
EditRequest: req,
|
||||||
|
AsyncMode: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := v.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
|
||||||
|
}
|
||||||
@@ -42,6 +42,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
|
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
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
@@ -60,6 +60,12 @@ type ItemVGPU struct {
|
|||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Node ID
|
||||||
|
NodeID uint64 `json:"node_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of VGPU
|
// List of VGPU
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type CreateInAccountRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperCreateInAccountRequest struct {
|
type asyncWrapperCreateInAccountRequest struct {
|
||||||
CreateInAccountRequest
|
CreateInAccountRequest
|
||||||
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateInAccount creates VINS in account level
|
// CreateInAccount creates VINS in account level
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ type CreateInRGRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperCreateInRgRequest struct {
|
type asyncWrapperCreateInRgRequest struct {
|
||||||
CreateInRGRequest
|
CreateInRGRequest
|
||||||
AsyncMode bool `url:"asyncMode" json:"asyncMode"`
|
AsyncMode bool `url:"async_mode" json:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateInRG creates VINS in resource group level
|
// CreateInRG creates VINS in resource group level
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type EnableRequest struct {
|
|||||||
|
|
||||||
type asyncWrapperEnableRequest struct {
|
type asyncWrapperEnableRequest struct {
|
||||||
EnableRequest
|
EnableRequest
|
||||||
AsyncMode bool `url:"asyncMode"`
|
AsyncMode bool `url:"async_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable enables VINS by ID
|
// Enable enables VINS by ID
|
||||||
|
|||||||
@@ -184,6 +184,9 @@ type ItemInterface struct {
|
|||||||
|
|
||||||
// List of VNF IDs
|
// List of VNF IDs
|
||||||
VNFs []uint64 `json:"vnfs"`
|
VNFs []uint64 `json:"vnfs"`
|
||||||
|
|
||||||
|
// Whether default gateway is enabled
|
||||||
|
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of interfaces
|
// List of interfaces
|
||||||
@@ -304,6 +307,9 @@ type VNFsConfig struct {
|
|||||||
|
|
||||||
// List of reservations
|
// List of reservations
|
||||||
Reservations ListReservations `json:"reservations"`
|
Reservations ListReservations `json:"reservations"`
|
||||||
|
|
||||||
|
// Whether default gateway is enabled
|
||||||
|
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Primary
|
// Primary
|
||||||
|
|||||||
Loaded 100 of 123 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user