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/cloudapi/kvmvm/utilities/utility_data_source_compute...

29 lines
845 B

package utilities
import (
"context"
"github.com/hashicorp/terraform-plugin-log/tflog"
decort "repository.basistech.ru/BASIS/decort-golang-sdk"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
"repository.basistech.ru/BASIS/terraform-provider-dynamix/internal/service/cloudapi/kvmvm/models"
)
func ComputeUserListCheckPresence(ctx context.Context, state *models.ListUsersModel, c *decort.DecortClient) (*compute.ListUsers, error) {
tflog.Info(ctx, "Get compute user list info")
req := compute.UserListRequest{
ComputeID: uint64(state.ComputeID.ValueInt64()),
}
tflog.Info(ctx, "Check req", map[string]any{"req": req})
userList, err := c.CloudAPI().Compute().UserList(ctx, req)
if err != nil {
return nil, err
}
tflog.Info(ctx, "Getting compute user list info, successfully")
return userList, nil
}