4.7.0
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
cb_account "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
||||
cb_compute "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/compute"
|
||||
cb_disks "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/disks"
|
||||
cb_dpdk "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/dpdknet"
|
||||
cb_extnet "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
|
||||
cb_gid "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
||||
cb_image "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/image"
|
||||
@@ -284,6 +285,39 @@ func ExistVFPools(ctx context.Context, vfpoolIds []uint64, c *controller.Control
|
||||
return errs
|
||||
}
|
||||
|
||||
func ExistDPDKNet(ctx context.Context, dpdkIds []uint64, c *controller.ControllerCfg) []error {
|
||||
var errs []error
|
||||
|
||||
if len(dpdkIds) == 0 {
|
||||
return errs
|
||||
}
|
||||
|
||||
req := cb_dpdk.ListRequest{}
|
||||
|
||||
dpdkList, err := c.CloudBroker().DPDKNet().List(ctx, req)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
return errs
|
||||
}
|
||||
|
||||
for _, dpdkId := range dpdkIds {
|
||||
found := false
|
||||
|
||||
for _, dpdk := range dpdkList.Data {
|
||||
if dpdkId == dpdk.ID {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
errs = append(errs, fmt.Errorf("DPDKNet with ID %v not found", dpdkId))
|
||||
}
|
||||
}
|
||||
|
||||
return errs
|
||||
}
|
||||
|
||||
func ExistExtNetInLb(ctx context.Context, extNetId uint64, c *controller.ControllerCfg) error {
|
||||
if extNetId == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user