1.2.2
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user