This commit is contained in:
2024-11-12 13:41:38 +03:00
parent 040af43607
commit 36879efd58
517 changed files with 37877 additions and 1900 deletions

View File

@@ -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