func IsDBServerEmpty(ctx context.Context, id string, client driver.Client) error {
	ctxChild, cancel := context.WithTimeout(ctx, GetRequestTimeout())
	defer cancel()
	c, err := client.Cluster(ctxChild)
	if err != nil {
		return errors.WithStack(errors.Wrapf(err, "Cannot obtain Cluster"))
	}
	ctxChild, cancel = context.WithTimeout(ctx, GetRequestTimeout())
	defer cancel()
	dbs, err := client.Databases(ctxChild)
	if err != nil {
		return errors.WithStack(errors.Wrapf(err, "Cannot fetch databases"))
	}
	var inventory driver.DatabaseInventory
	for _, db := range dbs {
		err := RunWithTimeout(ctx, func(ctxChild context.Context) error {
			var err error
			inventory, err = c.DatabaseInventory(ctxChild, db)
			return err
		})
		if err != nil {
			return errors.WithStack(errors.Wrapf(err, "Cannot fetch inventory for %s", db.Name()))
		}
		for _, col := range inventory.Collections {
			for shardID, serverIDs := range col.Parameters.Shards {
				for _, serverID := range serverIDs {
					if string(serverID) == id {
						return errors.WithStack(errors.Newf("DBServer still used in shard %s of %s.%s", shardID, col.Parameters.Name, db.Name()))
					}
				}
			}
		}
	}
	return nil
}
IsDBServerEmpty checks if the dbserver identified by the given ID no longer has any
data on it.
The given driver must have all coordinators as endpoints.
The functions returns an error when the check could not be completed or the dbserver
is not empty, or nil when the dbserver is found to be empty.
package arangod
import (
	"context"
	"github.com/arangodb/kube-arangodb/pkg/util/errors"
	driver "github.com/arangodb/go-driver"
)