1.2.0
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
decort "repository.basistech.ru/BASIS/decort-golang-sdk"
|
||||
account "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
||||
extnet "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
|
||||
grid "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
||||
@@ -13,9 +12,10 @@ import (
|
||||
lb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/lb"
|
||||
rg "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
||||
vins "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vins"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/client"
|
||||
)
|
||||
|
||||
func ExistRG(ctx context.Context, rgId uint64, c *decort.DecortClient) error {
|
||||
func ExistRG(ctx context.Context, rgId uint64, c *client.Client) error {
|
||||
req := rg.ListRequest{
|
||||
ByID: rgId,
|
||||
IncludeDeleted: false,
|
||||
@@ -33,7 +33,7 @@ func ExistRG(ctx context.Context, rgId uint64, c *decort.DecortClient) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistAccount(ctx context.Context, accountId uint64, c *decort.DecortClient) error {
|
||||
func ExistAccount(ctx context.Context, accountId uint64, c *client.Client) error {
|
||||
req := account.ListRequest{
|
||||
ByID: accountId,
|
||||
}
|
||||
@@ -50,7 +50,7 @@ func ExistAccount(ctx context.Context, accountId uint64, c *decort.DecortClient)
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistAccounts(ctx context.Context, accountIds []uint64, c *decort.DecortClient) error {
|
||||
func ExistAccounts(ctx context.Context, accountIds []uint64, c *client.Client) error {
|
||||
req := account.ListRequest{}
|
||||
|
||||
accountList, err := c.CloudBroker().Account().List(ctx, req)
|
||||
@@ -85,7 +85,7 @@ func ExistAccounts(ctx context.Context, accountIds []uint64, c *decort.DecortCli
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistRGs(ctx context.Context, rgIDs []uint64, c *decort.DecortClient) error {
|
||||
func ExistRGs(ctx context.Context, rgIDs []uint64, c *client.Client) error {
|
||||
req := rg.ListRequest{
|
||||
IncludeDeleted: false,
|
||||
}
|
||||
@@ -123,7 +123,7 @@ func ExistRGs(ctx context.Context, rgIDs []uint64, c *decort.DecortClient) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistLB(ctx context.Context, lbId uint64, c *decort.DecortClient) error {
|
||||
func ExistLB(ctx context.Context, lbId uint64, c *client.Client) error {
|
||||
req := lb.ListRequest{
|
||||
ByID: lbId,
|
||||
}
|
||||
@@ -140,7 +140,7 @@ func ExistLB(ctx context.Context, lbId uint64, c *decort.DecortClient) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistLBFrontend(ctx context.Context, lbId uint64, fName string, c *decort.DecortClient) error {
|
||||
func ExistLBFrontend(ctx context.Context, lbId uint64, fName string, c *client.Client) error {
|
||||
lb, err := c.CloudBroker().LB().Get(ctx, lb.GetRequest{LBID: lbId})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -156,7 +156,7 @@ func ExistLBFrontend(ctx context.Context, lbId uint64, fName string, c *decort.D
|
||||
return fmt.Errorf("frontend with name %v not found", fName)
|
||||
}
|
||||
|
||||
func ExistLBBackend(ctx context.Context, lbId uint64, bName string, c *decort.DecortClient) error {
|
||||
func ExistLBBackend(ctx context.Context, lbId uint64, bName string, c *client.Client) error {
|
||||
lb, err := c.CloudBroker().LB().Get(ctx, lb.GetRequest{LBID: lbId})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -172,7 +172,7 @@ func ExistLBBackend(ctx context.Context, lbId uint64, bName string, c *decort.De
|
||||
return fmt.Errorf("backend with name %v not found", bName)
|
||||
}
|
||||
|
||||
func ExistExtNetInLb(ctx context.Context, extNetId uint64, c *decort.DecortClient) error {
|
||||
func ExistExtNetInLb(ctx context.Context, extNetId uint64, c *client.Client) error {
|
||||
if extNetId == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -192,7 +192,7 @@ func ExistExtNetInLb(ctx context.Context, extNetId uint64, c *decort.DecortClien
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistVinsInLb(ctx context.Context, vinsId uint64, c *decort.DecortClient) error {
|
||||
func ExistVinsInLb(ctx context.Context, vinsId uint64, c *client.Client) error {
|
||||
if vinsId == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -213,7 +213,7 @@ func ExistVinsInLb(ctx context.Context, vinsId uint64, c *decort.DecortClient) e
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistExtNetInVins(ctx context.Context, extNetId int, c *decort.DecortClient) error {
|
||||
func ExistExtNetInVins(ctx context.Context, extNetId int, c *client.Client) error {
|
||||
if extNetId == 0 || extNetId == -1 {
|
||||
return nil
|
||||
}
|
||||
@@ -233,7 +233,7 @@ func ExistExtNetInVins(ctx context.Context, extNetId int, c *decort.DecortClient
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistGID(ctx context.Context, gid uint64, c *decort.DecortClient) error {
|
||||
func ExistGID(ctx context.Context, gid uint64, c *client.Client) error {
|
||||
req := grid.ListRequest{}
|
||||
|
||||
gridList, err := c.CloudBroker().Grid().List(ctx, req)
|
||||
@@ -250,7 +250,7 @@ func ExistGID(ctx context.Context, gid uint64, c *decort.DecortClient) error {
|
||||
return fmt.Errorf("GID with id %v not found", gid)
|
||||
}
|
||||
|
||||
func ExistVins(ctx context.Context, vinsId uint64, c *decort.DecortClient) error {
|
||||
func ExistVins(ctx context.Context, vinsId uint64, c *client.Client) error {
|
||||
req := vins.ListRequest{
|
||||
ByID: vinsId,
|
||||
IncludeDeleted: false,
|
||||
@@ -268,7 +268,7 @@ func ExistVins(ctx context.Context, vinsId uint64, c *decort.DecortClient) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistImages(ctx context.Context, imageIDs []uint64, c *decort.DecortClient) error {
|
||||
func ExistImages(ctx context.Context, imageIDs []uint64, c *client.Client) error {
|
||||
req := image.ListRequest{}
|
||||
|
||||
listImages, err := c.CloudBroker().Image().List(ctx, req)
|
||||
@@ -304,7 +304,7 @@ func ExistImages(ctx context.Context, imageIDs []uint64, c *decort.DecortClient)
|
||||
return nil
|
||||
}
|
||||
|
||||
func ExistExtNetInRG(ctx context.Context, extNetId, accountId uint64, c *decort.DecortClient) error {
|
||||
func ExistExtNetInRG(ctx context.Context, extNetId, accountId uint64, c *client.Client) error {
|
||||
req := extnet.ListRequest{
|
||||
AccountID: accountId,
|
||||
ByID: extNetId,
|
||||
|
||||
Reference in New Issue
Block a user