budgets

package
v0.0.1-dev.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionConfiguration

type ActionConfiguration struct {
	// <Databricks> action configuration ID.
	ActionConfigurationId *string
	// The type of the action.
	ActionType ActionConfigurationType
	// Target for the action. For example, an email address.
	Target *string
}

type ActionConfigurationType

type ActionConfigurationType string

Type of action that a budget alert executes when its threshold is crossed.

const (
	ActionConfigurationType_Unspecified       ActionConfigurationType = ""
	ActionConfigurationType_EmailNotification ActionConfigurationType = "EMAIL_NOTIFICATION"
	// Blocks further usage when the alert threshold is reached. Supported only on
	// AI Gateway budgets. No `target` is required for this action type.
	ActionConfigurationType_BlockUsage ActionConfigurationType = "BLOCK_USAGE"
)

type AlertConfiguration

type AlertConfiguration struct {
	// <Databricks> alert configuration ID.
	AlertConfigurationId *string
	// The time window of usage data for the budget.
	TimePeriod AlertConfigurationTimePeriod
	// The evaluation method to determine when this budget alert is in a triggered
	// state.
	TriggerType AlertConfigurationTriggerType
	// The way to calculate cost for this budget alert. This is what
	// `quantity_threshold` is measured in.
	QuantityType AlertConfigurationQuantityType
	// The threshold for the budget alert to determine if it is in a triggered
	// state. The number is evaluated based on `quantity_type`.
	QuantityThreshold *string
	// Configured actions for this alert. These define what happens when an alert
	// enters a triggered state.
	ActionConfigurations []ActionConfiguration
	// How the alert threshold is evaluated. Determines whether spend is tracked in
	// aggregate or per individual user.
	ScopeType AlertConfigurationScopeType
	// Per-principal threshold overrides for this alert. Only applies to per-user
	// alerts (`scope_type` = `ALERT_CONFIGURATION_SCOPE_TYPE_PER_USER`); ignored
	// for shared alerts.
	PrincipalOverrides []PrincipalOverride
}

type AlertConfigurationQuantityType

type AlertConfigurationQuantityType string
const (
	AlertConfigurationQuantityType_Unspecified         AlertConfigurationQuantityType = ""
	AlertConfigurationQuantityType_ListPriceDollarsUsd AlertConfigurationQuantityType = "LIST_PRICE_DOLLARS_USD"
)

type AlertConfigurationScopeType

type AlertConfigurationScopeType string

Evaluation scope for an alert configuration.

const (
	AlertConfigurationScopeType_Unspecified AlertConfigurationScopeType = ""
	// Alert evaluates aggregate spend across all users.
	AlertConfigurationScopeType_AlertConfigurationScopeTypeShared AlertConfigurationScopeType = "ALERT_CONFIGURATION_SCOPE_TYPE_SHARED"
	// Alert evaluates spend per individual user identity.
	AlertConfigurationScopeType_AlertConfigurationScopeTypePerUser AlertConfigurationScopeType = "ALERT_CONFIGURATION_SCOPE_TYPE_PER_USER"
)

type AlertConfigurationTimePeriod

type AlertConfigurationTimePeriod string
const (
	AlertConfigurationTimePeriod_Unspecified AlertConfigurationTimePeriod = ""
	AlertConfigurationTimePeriod_Month       AlertConfigurationTimePeriod = "MONTH"
)

type AlertConfigurationTriggerType

type AlertConfigurationTriggerType string
const (
	AlertConfigurationTriggerType_Unspecified                AlertConfigurationTriggerType = ""
	AlertConfigurationTriggerType_CumulativeSpendingExceeded AlertConfigurationTriggerType = "CUMULATIVE_SPENDING_EXCEEDED"
)

type BudgetConfiguration

type BudgetConfiguration struct {
	// <Databricks> budget configuration ID.
	BudgetConfigurationId *string
	// <Databricks> account ID.
	AccountId *string
	// Creation time of this budget configuration.
	CreateTime *int64
	// Update time of this budget configuration.
	UpdateTime *int64
	// Alerts to configure when this budget is in a triggered state. Budgets must
	// have exactly one alert configuration.
	AlertConfigurations []AlertConfiguration
	// Configured filters for this budget. These are applied to your account's usage
	// to limit the scope of what is considered for this budget. Leave empty to
	// include all usage for this account. All provided filters must be matched for
	// usage to be included.
	Filter *BudgetConfigurationFilter
	// Human-readable name of budget configuration. Max Length: 128
	DisplayName *string
	// The resource scope for this budget. Determines whether the budget tracks all
	// resources or a specific resource.
	ResourceType BudgetResourceType
}

type BudgetConfigurationFilter

type BudgetConfigurationFilter struct {
	// If provided, usage must match with the provided <Databricks> workspace IDs.
	WorkspaceId *BudgetConfigurationFilter_WorkspaceIdClause
	// A list of tag keys and values that will limit the budget to usage that
	// includes those specific custom tags. Tags are case-sensitive and should be
	// entered exactly as they appear in your usage data.
	Tags []BudgetConfigurationFilter_TagClause
}

type BudgetConfigurationFilter_Clause

type BudgetConfigurationFilter_Clause struct {
	Operator BudgetConfigurationFilter_Operator
	Values   []string
}

type BudgetConfigurationFilter_Operator

type BudgetConfigurationFilter_Operator string
const (
	BudgetConfigurationFilter_Operator_Unspecified BudgetConfigurationFilter_Operator = ""
	BudgetConfigurationFilter_Operator_In          BudgetConfigurationFilter_Operator = "IN"
)

type BudgetConfigurationFilter_TagClause

type BudgetConfigurationFilter_TagClause struct {
	Key   *string
	Value *BudgetConfigurationFilter_Clause
}

type BudgetConfigurationFilter_WorkspaceIdClause

type BudgetConfigurationFilter_WorkspaceIdClause struct {
	Operator BudgetConfigurationFilter_Operator
	Values   []int64
}

type BudgetResourceType

type BudgetResourceType string

Resource scope for a budget configuration. Determines whether the budget tracks all resources or a specific resource.

const (
	BudgetResourceType_Unspecified BudgetResourceType = ""
	// The budget applies to spending across all resources.
	BudgetResourceType_BudgetResourceTypeAllResources BudgetResourceType = "BUDGET_RESOURCE_TYPE_ALL_RESOURCES"
	// The budget applies only to Unity AI Gateway spending.
	BudgetResourceType_BudgetResourceTypeUnityAiGateway BudgetResourceType = "BUDGET_RESOURCE_TYPE_UNITY_AI_GATEWAY"
)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...client.Option) (*Client, error)

func (*Client) CreateBudgetConfiguration

func (c *Client) CreateBudgetConfiguration(ctx context.Context, req *CreateBudgetConfigurationRequest, opts ...call.Option) (*CreateBudgetConfigurationResponse, error)

Create a new budget configuration for an account. For full details, see https://docs.databricks.com/en/admin/account-settings/budgets.html. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) DeleteBudgetConfiguration

func (c *Client) DeleteBudgetConfiguration(ctx context.Context, req *DeleteBudgetConfigurationRequest, opts ...call.Option) (*DeleteBudgetConfigurationResponse, error)

Deletes a budget configuration for an account. Both account and budget configuration are specified by ID. This cannot be undone. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) GetBudgetConfiguration

func (c *Client) GetBudgetConfiguration(ctx context.Context, req *GetBudgetConfigurationRequest, opts ...call.Option) (*GetBudgetConfigurationResponse, error)

Gets a budget configuration for an account. Both account and budget configuration are specified by ID. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListBudgetConfigurations

func (c *Client) ListBudgetConfigurations(ctx context.Context, req *ListBudgetConfigurationsRequest, opts ...call.Option) (*ListBudgetConfigurationsResponse, error)

Gets all budgets associated with this account. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

func (*Client) ListBudgetConfigurationsIter

func (c *Client) ListBudgetConfigurationsIter(ctx context.Context, req *ListBudgetConfigurationsRequest, opts ...call.Option) iter.Seq2[*BudgetConfiguration, error]

ListBudgetConfigurationsIter returns an iterator that iterates over the results of ListBudgetConfigurations.

For example:

for item, err := range c.ListBudgetConfigurationsIter(ctx, &ListBudgetConfigurationsRequest{}) {
  if err != nil {
    return err
  }
  fmt.Println(item)
}

Options opts are passed to each ListBudgetConfigurations call made by the iterator under the hood.

Callers who need custom pagination logic should use ListBudgetConfigurations directly.

func (*Client) UpdateBudgetConfiguration

func (c *Client) UpdateBudgetConfiguration(ctx context.Context, req *UpdateBudgetConfigurationRequest, opts ...call.Option) (*UpdateBudgetConfigurationResponse, error)

Updates a budget configuration for an account. Both account and budget configuration are specified by ID. Account-level method. Uses the Client's accountID, overridable per call via req.AccountId.

type CreateBudgetConfigurationBudget

type CreateBudgetConfigurationBudget struct {
	// <Databricks> budget configuration ID.
	BudgetConfigurationId *string
	// <Databricks> account ID.
	AccountId *string
	// Creation time of this budget configuration.
	CreateTime *int64
	// Update time of this budget configuration.
	UpdateTime *int64
	// Alerts to configure when this budget is in a triggered state. Budgets must
	// have exactly one alert configuration.
	AlertConfigurations []AlertConfiguration
	// Configured filters for this budget. These are applied to your account's usage
	// to limit the scope of what is considered for this budget. Leave empty to
	// include all usage for this account. All provided filters must be matched for
	// usage to be included.
	Filter *BudgetConfigurationFilter
	// Human-readable name of budget configuration. Max Length: 128
	DisplayName *string
	// The resource scope for this budget. Determines whether the budget tracks all
	// resources or a specific resource.
	ResourceType BudgetResourceType
}

type CreateBudgetConfigurationRequest

type CreateBudgetConfigurationRequest struct {
	// Properties of the new budget configuration.
	Budget *CreateBudgetConfigurationBudget
}

type CreateBudgetConfigurationResponse

type CreateBudgetConfigurationResponse struct {
	// The created budget configuration.
	Budget *BudgetConfiguration
}

type DeleteBudgetConfigurationRequest

type DeleteBudgetConfigurationRequest struct {
	// The <Databricks> budget configuration ID.
	BudgetId *string
	// <Databricks> account ID.
	AccountId *string
}

* Delete budget.

type DeleteBudgetConfigurationResponse

type DeleteBudgetConfigurationResponse struct {
}

type GetBudgetConfigurationRequest

type GetBudgetConfigurationRequest struct {
	// The budget configuration ID
	BudgetId *string
	// <Databricks> account ID.
	AccountId          *string
	IncludeSpendStatus *bool
}

type GetBudgetConfigurationResponse

type GetBudgetConfigurationResponse struct {
	Budget *BudgetConfiguration
}

type ListBudgetConfigurationsRequest

type ListBudgetConfigurationsRequest struct {
	// <Databricks> account ID.
	AccountId *string
	// A page token received from a previous get all budget configurations call.
	// This token can be used to retrieve the subsequent page. Requests first page
	// if absent.
	PageToken               *string
	IncludeSpendStatus      *bool
	IncludeWorkspaceBudgets *bool
}

type ListBudgetConfigurationsResponse

type ListBudgetConfigurationsResponse struct {
	Budgets []BudgetConfiguration
	// Token which can be sent as `page_token` to retrieve the next page of results.
	// If this field is omitted, there are no subsequent budgets.
	NextPageToken *string
}

type PrincipalOverride

type PrincipalOverride struct {
	// Account-level principal id (user, group, or service principal).
	PrincipalId *int64
	// Dollar amount that overrides the parent alert's quantity_threshold for this
	// principal.
	OverrideThreshold *string
}

Per-principal threshold override on a PER_USER alert: bumps the alert's quantity_threshold for one principal_id..

type UpdateBudgetConfigurationBudget

type UpdateBudgetConfigurationBudget struct {
	// <Databricks> budget configuration ID.
	BudgetConfigurationId *string
	// <Databricks> account ID.
	AccountId *string
	// Creation time of this budget configuration.
	CreateTime *int64
	// Update time of this budget configuration.
	UpdateTime *int64
	// Alerts to configure when this budget is in a triggered state. Budgets must
	// have exactly one alert configuration.
	AlertConfigurations []AlertConfiguration
	// Configured filters for this budget. These are applied to your account's usage
	// to limit the scope of what is considered for this budget. Leave empty to
	// include all usage for this account. All provided filters must be matched for
	// usage to be included.
	Filter *BudgetConfigurationFilter
	// Human-readable name of budget configuration. Max Length: 128
	DisplayName *string
	// The resource scope for this budget. Determines whether the budget tracks all
	// resources or a specific resource.
	ResourceType BudgetResourceType
}

type UpdateBudgetConfigurationRequest

type UpdateBudgetConfigurationRequest struct {
	// The <Databricks> budget configuration ID.
	BudgetId *string
	// The updated budget. This will overwrite the budget specified by the budget
	// ID.
	Budget *UpdateBudgetConfigurationBudget
}

type UpdateBudgetConfigurationResponse

type UpdateBudgetConfigurationResponse struct {
	// The updated budget.
	Budget *BudgetConfiguration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL