This commit is contained in:
asteam
2024-12-04 13:18:58 +03:00
parent 003e4d656e
commit 76ea459b3d
417 changed files with 30051 additions and 975 deletions

View File

@@ -9,6 +9,7 @@ import (
account "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/account"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/disks"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/dpdknet"
extnet "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/extnet"
image "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/image"
k8ci "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/k8ci"
@@ -448,6 +449,30 @@ func ExistVFPool(ctx context.Context, vfpoolId uint64, c *decort.DecortClient) e
return nil
}
func ExistDPDK(ctx context.Context, dpdkId uint64, c *decort.DecortClient) error {
req := dpdknet.ListRequest{
ByID: dpdkId,
}
dpdkList, err := c.CloudAPI().DPDKNet().List(ctx, req)
if err != nil {
return err
}
if len(dpdkList.Data) == 0 {
return fmt.Errorf("DPDK net with ID %v not found", dpdkId)
}
for _, item := range dpdkList.Data {
if item.Status != "ENABLED" {
return fmt.Errorf("DPDK net with ID %v must be enabled", dpdkId)
}
}
return nil
}
func ExistSnapshotInCompute(ctx context.Context, computeID uint64, label string, c *decort.DecortClient) error {
req := compute.SnapshotListRequest{
ComputeID: computeID,