You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform-provider-dynamix/internal/service/cloudbroker/rg/utilities/utility_data_source_rg_affi...

30 lines
1.1 KiB

package utilities
import (
"context"
"fmt"
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/service/cloudbroker/rg/models"
"github.com/hashicorp/terraform-plugin-log/tflog"
decort "repository.basistech.ru/BASIS/decort-golang-sdk"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
)
func RGAffinityGroupsGetCheckPresence(ctx context.Context, plan *models.DataSourceRGAffinityGroupsGetModel, c *decort.DecortClient) ([]uint64, error) {
agReq := rg.AffinityGroupsGetRequest{
RGID: uint64(plan.RGID.ValueInt64()),
AffinityGroup: plan.AffinityGroup.ValueString(),
}
tflog.Info(ctx, "RGAffinityGroupsGetCheckPresence: before call CloudBroker().RG().AffinityGroupsGet", map[string]any{"req": agReq})
agItem, err := c.CloudBroker().RG().AffinityGroupsGet(ctx, agReq)
if err != nil {
return nil, fmt.Errorf("cannot get info about resource group affinity groups get with error: %w", err)
}
tflog.Info(ctx, "RGAffinityGroupsGetCheckPresence: response from CloudBroker().RG().AffinityGroupsGet", map[string]any{"response": agItem})
return agItem, err
}