databricks-cli/bundle/config/variable/resolve_warehouse.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
428 B
Go
Raw Normal View History

package variable
import (
"context"
"github.com/databricks/databricks-sdk-go"
)
type resolveWarehouse struct {
name string
}
func (l resolveWarehouse) Resolve(ctx context.Context, w *databricks.WorkspaceClient) (string, error) {
entity, err := w.Warehouses.GetByName(ctx, l.name)
if err != nil {
return "", err
}
return entity.Id, nil
}
func (l resolveWarehouse) String() string {
return "warehouse: " + l.name
}