parent
9a7a7b6f36
commit
8eeef825c0
@ -1,33 +1,5 @@
|
|||||||
## Version 1.8.1
|
## Version 1.8.2
|
||||||
|
|
||||||
### Feature
|
### Feature
|
||||||
|
|
||||||
- Add NumaAffinity, CPUPin and HPBacked fields to model CreateRequest in cloudapi/kvmx86 and cloudbroker/kvmx86
|
- Add universal client for connections
|
||||||
- Add NumaAffinity, CPUPin and HPBacked fields to model UpdateRequest in cloudapi/compute and cloudbroker/compute
|
|
||||||
- Add ReservedNodeCpus field to models ItemCompute, RecordCompute in cloudapi/compute and to models ItemCompute, InfoCompute in cloudbroker/compute
|
|
||||||
- Add VFNIC as possible NetType value in Interfaces field in model CreateRequest in cloudapi/kvmx86 and cloudbroker/kvmx86
|
|
||||||
- Add VFNIC as possible NetType value in model NetAttachRequest in cloudapi/compute and cloudbroker/compute
|
|
||||||
- Add WithoutBootDisk field to models CreateRequest, CreateBlankRequest, MassCreateRequest in cloudapi/kvmx86 and cloudbroker/kvmx86
|
|
||||||
- Set optional fields BootDisk, SEPID, Pool in model CreateBlankRequest in cloudapi/kvmx86 and cloudbroker/kvmx86
|
|
||||||
- Set optional field ImageID in model CreateRequest in cloudapi/kvmx86 and cloudbroker/kvmx86
|
|
||||||
- Add field VNFDevID in models ListRequest (cloudbrocker/vins/list) and ListDeletedRequest (cloudapi/vins/list_deleted)
|
|
||||||
- Add new endpoints /cloudbroker/disks/present and /cloudbroker/disks/depresent
|
|
||||||
- Add field AuditID in model ListRequest (cloudbrocker/tasks/list, cloudapi/tasks/list)
|
|
||||||
- Add field ClientIDs in model ListRequest (cloudbrocker/flipgroup/list, cloudapi/flipgroup/list)
|
|
||||||
- Add field Depresent in model StopRequest (cloudbrocker/compute/stop)
|
|
||||||
- Add new endpoint /cloudbroker/image/uploadImageFile
|
|
||||||
|
|
||||||
### Bugfix
|
|
||||||
|
|
||||||
- Change the return value of the method ReplicationStatus from interface to string in cloudapi/disks and cloudbroker/disks
|
|
||||||
- Fix type field Replication in models ItemComputeDisk (cloudapi/compute), ItemDisk (cloudapi/disks, cloudbroker/disks), RecordDisk (cloudapi/disks), InfoDisk (cloudbroker/compute). Add type ItemReplication in models cloudapi/disks, cloudbroker/disks, cloudapi/compute, cloudbroker/compute
|
|
||||||
- Rename field Async to AsyncMode in cloudapi/compute, cloudbroker/compute, cloudbroker/backup
|
|
||||||
- Fix url tags in fields UpdateTimeAt and UpdateTimeTo in models ListRequest (cloudapi/tasks/list, cloudbroker/tasks/list)
|
|
||||||
- Fix type field Completed in models ListRequest (cloudapi/tasks/list, cloudbroker/tasks/list)
|
|
||||||
- Fix type field Shared in models ListRequest (cloudapi/disk/list, cloudbroker/disk/list)
|
|
||||||
- Fix type field Shared in models ListDeletedRequest (cloudapi/disk/list_deleted, cloudbroker/disk/list_deleted)
|
|
||||||
- Fix type field Public, HotResize, Bootable in models ListRequest (cloudapi/image/list, cloudbroker/image/list)
|
|
||||||
- Fix type field Active, ServiceAccount in model ListRequest (cloudbroker/user/list)
|
|
||||||
- Change required type and correct description in field ImageID in model MassCreateRequest (cloudbroker/kvmx86/mass_create)
|
|
||||||
- Delete field AccountID in model ListLBRequest (cloudbroker/rg/listLB, cloudapi/rg/listLB)
|
|
||||||
-
|
|
@ -0,0 +1,8 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
// UniversalConfig combines configurations for different types of clients
|
||||||
|
type UniversalConfig struct {
|
||||||
|
Decs3oConfig *Config `json:"decs3oConfig,omitempty" yaml:"decs3oConfig,omitempty"`
|
||||||
|
BVSConfig *BVSConfig `json:"bvsConfig,omitempty" yaml:"bvsConfig,omitempty"`
|
||||||
|
LegacyConfig *LegacyConfig `json:"legacyConfig,omitempty" yaml:"legacyConfig,omitempty"`
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package decortsdk
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/config"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ClientInterface interface {
|
||||||
|
CloudAPI() *cloudapi.CloudAPI
|
||||||
|
CloudBroker() *cloudbroker.CloudBroker
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUniversal(cfg config.UniversalConfig) (ClientInterface, error) {
|
||||||
|
countConfigs := 0
|
||||||
|
var client ClientInterface
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case cfg.Decs3oConfig != nil && reflect.TypeOf(*cfg.Decs3oConfig) == reflect.TypeOf(config.Config{}):
|
||||||
|
client = New(*cfg.Decs3oConfig)
|
||||||
|
countConfigs++
|
||||||
|
case cfg.BVSConfig != nil && reflect.TypeOf(*cfg.BVSConfig) == reflect.TypeOf(config.BVSConfig{}):
|
||||||
|
client = NewBVS(*cfg.BVSConfig)
|
||||||
|
countConfigs++
|
||||||
|
case cfg.LegacyConfig != nil && reflect.TypeOf(*cfg.LegacyConfig) == reflect.TypeOf(config.LegacyConfig{}):
|
||||||
|
client = NewLegacy(*cfg.LegacyConfig)
|
||||||
|
countConfigs++
|
||||||
|
}
|
||||||
|
if countConfigs != 1 {
|
||||||
|
return nil, fmt.Errorf("only 1 config can be used at a time")
|
||||||
|
}
|
||||||
|
|
||||||
|
return client, nil
|
||||||
|
}
|
Loading…
Reference in new issue