This commit is contained in:
asteam
2025-04-17 12:31:12 +03:00
parent b8f118097e
commit 5382579a5f
166 changed files with 16413 additions and 221 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
account "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/account"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/bservice"
"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"
@@ -523,3 +524,40 @@ func ExistLBFrontend(ctx context.Context, lbId uint64, fName string, c *client.C
return fmt.Errorf("frontend with name %v not found", fName)
}
func ExistBservise(ctx context.Context, serviceID uint64, c *client.Client) error {
req := bservice.ListRequest{
ByID: serviceID,
}
rgList, err := c.CloudAPI().BService().List(ctx, req)
if err != nil {
return err
}
if len(rgList.Data) == 0 {
return fmt.Errorf("Bservice with id %v not found", serviceID)
}
for _, v := range rgList.Data {
if v.Status != "ENABLED" {
return fmt.Errorf("Bservice with id %v should be enabled", serviceID)
}
}
return nil
}
func ExistBserviseGroup(ctx context.Context, serviseID uint64, compGroupID uint64, c *client.Client) error {
req := bservice.GroupGetRequest{
ServiceID: serviseID,
CompGroupID: compGroupID,
}
_, err := c.CloudAPI().BService().GroupGet(ctx, req)
if err != nil {
return err
}
return nil
}