Billing

These dataclasses are used in the SDK to represent API requests and responses for services in the databricks.sdk.service.billing module.

class databricks.sdk.service.billing.Budget

Budget configuration to be created.

name: str

Human-readable name of the budget.

period: str

Period length in years, months, weeks and/or days. Examples: 1 month, 30 days, 1 year, 2 months, 1 week, 2 days

start_date: str

Start date of the budget period calculation.

target_amount: str

Target amount of the budget per period in USD.

filter: str

SQL-like filter expression with workspaceId, SKU and tag. Usage in your account that matches this expression will be counted in this budget.

Supported properties on left-hand side of comparison: * workspaceId - the ID of the workspace * sku - SKU of the cluster, e.g. STANDARD_ALL_PURPOSE_COMPUTE * tag.tagName, tag.’tag name’ - tag of the cluster

Supported comparison operators: * = - equal * != - not equal

Supported logical operators: AND, OR.

Examples: * workspaceId=123 OR (sku=’STANDARD_ALL_PURPOSE_COMPUTE’ AND tag.’my tag’=’my value’) * workspaceId!=456 * sku=’STANDARD_ALL_PURPOSE_COMPUTE’ OR sku=’PREMIUM_ALL_PURPOSE_COMPUTE’ * tag.name1=’value1’ AND tag.name2=’value2’

alerts: List[BudgetAlert] | None = None
end_date: str | None = None

Optional end date of the budget.

as_dict() dict

Serializes the Budget into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) Budget

Deserializes the Budget from a dictionary.

class databricks.sdk.service.billing.BudgetAlert
email_notifications: List[str] | None = None

List of email addresses to be notified when budget percentage is exceeded in the given period.

min_percentage: int | None = None

Percentage of the target amount used in the currect period that will trigger a notification.

as_dict() dict

Serializes the BudgetAlert into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) BudgetAlert

Deserializes the BudgetAlert from a dictionary.

class databricks.sdk.service.billing.BudgetList

List of budgets.

budgets: List[BudgetWithStatus] | None = None
as_dict() dict

Serializes the BudgetList into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) BudgetList

Deserializes the BudgetList from a dictionary.

class databricks.sdk.service.billing.BudgetWithStatus

Budget configuration with daily status.

alerts: List[BudgetAlert] | None = None
budget_id: str | None = None
creation_time: str | None = None
end_date: str | None = None

Optional end date of the budget.

filter: str | None = None

SQL-like filter expression with workspaceId, SKU and tag. Usage in your account that matches this expression will be counted in this budget.

Supported properties on left-hand side of comparison: * workspaceId - the ID of the workspace * sku - SKU of the cluster, e.g. STANDARD_ALL_PURPOSE_COMPUTE * tag.tagName, tag.’tag name’ - tag of the cluster

Supported comparison operators: * = - equal * != - not equal

Supported logical operators: AND, OR.

Examples: * workspaceId=123 OR (sku=’STANDARD_ALL_PURPOSE_COMPUTE’ AND tag.’my tag’=’my value’) * workspaceId!=456 * sku=’STANDARD_ALL_PURPOSE_COMPUTE’ OR sku=’PREMIUM_ALL_PURPOSE_COMPUTE’ * tag.name1=’value1’ AND tag.name2=’value2’

name: str | None = None

Human-readable name of the budget.

period: str | None = None

Period length in years, months, weeks and/or days. Examples: 1 month, 30 days, 1 year, 2 months, 1 week, 2 days

start_date: str | None = None

Start date of the budget period calculation.

status_daily: List[BudgetWithStatusStatusDailyItem] | None = None

Amount used in the budget for each day (noncumulative).

target_amount: str | None = None

Target amount of the budget per period in USD.

update_time: str | None = None
as_dict() dict

Serializes the BudgetWithStatus into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) BudgetWithStatus

Deserializes the BudgetWithStatus from a dictionary.

class databricks.sdk.service.billing.BudgetWithStatusStatusDailyItem
amount: str | None = None

Amount used in this day in USD.

date: str | None = None
as_dict() dict

Serializes the BudgetWithStatusStatusDailyItem into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) BudgetWithStatusStatusDailyItem

Deserializes the BudgetWithStatusStatusDailyItem from a dictionary.

class databricks.sdk.service.billing.CreateLogDeliveryConfigurationParams
log_type: LogType

Log delivery type. Supported values are:

  • BILLABLE_USAGE — Configure [billable usage log delivery]. For the CSV schema, see the

[View billable usage].

  • AUDIT_LOGS — Configure [audit log delivery]. For the JSON schema, see [Configure audit

logging]

[Configure audit logging]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

output_format: OutputFormat

The file type of log delivery.

  • If log_type is BILLABLE_USAGE, this value must be CSV. Only the CSV (comma-separated

values) format is supported. For the schema, see the [View billable usage] * If log_type is AUDIT_LOGS, this value must be JSON. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs].

[Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html

credentials_id: str

The ID for a method:credentials/create that represents the AWS IAM role with policy and trust relationship as described in the main billable usage documentation page. See [Configure billable usage delivery].

[Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

storage_configuration_id: str

The ID for a method:storage/create that represents the S3 bucket with bucket policy as described in the main billable usage documentation page. See [Configure billable usage delivery].

[Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

config_name: str | None = None

The optional human-readable name of the log delivery configuration. Defaults to empty.

delivery_path_prefix: str | None = None

The optional delivery path prefix within Amazon S3 storage. Defaults to empty, which means that logs are delivered to the root of the bucket. This must be a valid S3 object key. This must not start or end with a slash character.

delivery_start_time: str | None = None

This field applies only if log_type is BILLABLE_USAGE. This is the optional start month and year for delivery, specified in YYYY-MM format. Defaults to current year and month. BILLABLE_USAGE logs are not available for usage before March 2019 (2019-03).

status: LogDeliveryConfigStatus | None = None

Status of log delivery configuration. Set to ENABLED (enabled) or DISABLED (disabled). Defaults to ENABLED. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed.

workspace_ids_filter: List[int] | None = None

Optional filter that specifies workspace IDs to deliver logs for. By default the workspace filter is empty and log delivery applies at the account level, delivering workspace-level logs for all workspaces in your account, plus account level logs. You can optionally set this field to an array of workspace IDs (each one is an int64) to which log delivery should apply, in which case only workspace-level logs relating to the specified workspaces are delivered. If you plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won’t apply to new workspaces created in the future, and delivery won’t include account level logs. For some types of Databricks deployments there is only one workspace per account ID, so this field is unnecessary.

as_dict() dict

Serializes the CreateLogDeliveryConfigurationParams into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) CreateLogDeliveryConfigurationParams

Deserializes the CreateLogDeliveryConfigurationParams from a dictionary.

class databricks.sdk.service.billing.DeleteResponse
as_dict() dict

Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DeleteResponse

Deserializes the DeleteResponse from a dictionary.

class databricks.sdk.service.billing.DeliveryStatus

The status string for log delivery. Possible values are: * CREATED: There were no log delivery attempts since the config was created. * SUCCEEDED: The latest attempt of log delivery has succeeded completely. * USER_FAILURE: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage. * SYSTEM_FAILURE: The latest attempt of log delivery failed because of an Databricks internal error. Contact support if it doesn’t go away soon. * NOT_FOUND: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account.

CREATED = "CREATED"
NOT_FOUND = "NOT_FOUND"
SUCCEEDED = "SUCCEEDED"
SYSTEM_FAILURE = "SYSTEM_FAILURE"
USER_FAILURE = "USER_FAILURE"
class databricks.sdk.service.billing.DownloadResponse
contents: BinaryIO | None = None
as_dict() dict

Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) DownloadResponse

Deserializes the DownloadResponse from a dictionary.

class databricks.sdk.service.billing.LogDeliveryConfigStatus

Status of log delivery configuration. Set to ENABLED (enabled) or DISABLED (disabled). Defaults to ENABLED. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed.

DISABLED = "DISABLED"
ENABLED = "ENABLED"
class databricks.sdk.service.billing.LogDeliveryConfiguration
account_id: str | None = None

The Databricks account ID that hosts the log delivery configuration.

config_id: str | None = None

Databricks log delivery configuration ID.

config_name: str | None = None

The optional human-readable name of the log delivery configuration. Defaults to empty.

creation_time: int | None = None

Time in epoch milliseconds when the log delivery configuration was created.

credentials_id: str | None = None

The ID for a method:credentials/create that represents the AWS IAM role with policy and trust relationship as described in the main billable usage documentation page. See [Configure billable usage delivery].

[Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

delivery_path_prefix: str | None = None

The optional delivery path prefix within Amazon S3 storage. Defaults to empty, which means that logs are delivered to the root of the bucket. This must be a valid S3 object key. This must not start or end with a slash character.

delivery_start_time: str | None = None

This field applies only if log_type is BILLABLE_USAGE. This is the optional start month and year for delivery, specified in YYYY-MM format. Defaults to current year and month. BILLABLE_USAGE logs are not available for usage before March 2019 (2019-03).

log_delivery_status: LogDeliveryStatus | None = None

Databricks log delivery status.

log_type: LogType | None = None

Log delivery type. Supported values are:

  • BILLABLE_USAGE — Configure [billable usage log delivery]. For the CSV schema, see the

[View billable usage].

  • AUDIT_LOGS — Configure [audit log delivery]. For the JSON schema, see [Configure audit

logging]

[Configure audit logging]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

output_format: OutputFormat | None = None

The file type of log delivery.

  • If log_type is BILLABLE_USAGE, this value must be CSV. Only the CSV (comma-separated

values) format is supported. For the schema, see the [View billable usage] * If log_type is AUDIT_LOGS, this value must be JSON. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs].

[Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html

status: LogDeliveryConfigStatus | None = None

Status of log delivery configuration. Set to ENABLED (enabled) or DISABLED (disabled). Defaults to ENABLED. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed.

storage_configuration_id: str | None = None

The ID for a method:storage/create that represents the S3 bucket with bucket policy as described in the main billable usage documentation page. See [Configure billable usage delivery].

[Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

update_time: int | None = None

Time in epoch milliseconds when the log delivery configuration was updated.

workspace_ids_filter: List[int] | None = None

Optional filter that specifies workspace IDs to deliver logs for. By default the workspace filter is empty and log delivery applies at the account level, delivering workspace-level logs for all workspaces in your account, plus account level logs. You can optionally set this field to an array of workspace IDs (each one is an int64) to which log delivery should apply, in which case only workspace-level logs relating to the specified workspaces are delivered. If you plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won’t apply to new workspaces created in the future, and delivery won’t include account level logs. For some types of Databricks deployments there is only one workspace per account ID, so this field is unnecessary.

as_dict() dict

Serializes the LogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) LogDeliveryConfiguration

Deserializes the LogDeliveryConfiguration from a dictionary.

class databricks.sdk.service.billing.LogDeliveryStatus

Databricks log delivery status.

last_attempt_time: str | None = None

The UTC time for the latest log delivery attempt.

last_successful_attempt_time: str | None = None

The UTC time for the latest successful log delivery.

message: str | None = None

Informative message about the latest log delivery attempt. If the log delivery fails with USER_FAILURE, error details will be provided for fixing misconfigurations in cloud permissions.

status: DeliveryStatus | None = None

The status string for log delivery. Possible values are: * CREATED: There were no log delivery attempts since the config was created. * SUCCEEDED: The latest attempt of log delivery has succeeded completely. * USER_FAILURE: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage. * SYSTEM_FAILURE: The latest attempt of log delivery failed because of an Databricks internal error. Contact support if it doesn’t go away soon. * NOT_FOUND: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account.

as_dict() dict

Serializes the LogDeliveryStatus into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) LogDeliveryStatus

Deserializes the LogDeliveryStatus from a dictionary.

class databricks.sdk.service.billing.LogType

Log delivery type. Supported values are: * BILLABLE_USAGE — Configure [billable usage log delivery]. For the CSV schema, see the [View billable usage]. * AUDIT_LOGS — Configure [audit log delivery]. For the JSON schema, see [Configure audit logging] [Configure audit logging]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html

AUDIT_LOGS = "AUDIT_LOGS"
BILLABLE_USAGE = "BILLABLE_USAGE"
class databricks.sdk.service.billing.OutputFormat

The file type of log delivery. * If log_type is BILLABLE_USAGE, this value must be CSV. Only the CSV (comma-separated values) format is supported. For the schema, see the [View billable usage] * If log_type is AUDIT_LOGS, this value must be JSON. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs]. [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html

CSV = "CSV"
JSON = "JSON"
class databricks.sdk.service.billing.PatchStatusResponse
as_dict() dict

Serializes the PatchStatusResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) PatchStatusResponse

Deserializes the PatchStatusResponse from a dictionary.

class databricks.sdk.service.billing.UpdateLogDeliveryConfigurationStatusRequest
status: LogDeliveryConfigStatus

Status of log delivery configuration. Set to ENABLED (enabled) or DISABLED (disabled). Defaults to ENABLED. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed.

log_delivery_configuration_id: str | None = None

Databricks log delivery configuration ID

as_dict() dict

Serializes the UpdateLogDeliveryConfigurationStatusRequest into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) UpdateLogDeliveryConfigurationStatusRequest

Deserializes the UpdateLogDeliveryConfigurationStatusRequest from a dictionary.

class databricks.sdk.service.billing.UpdateResponse
as_dict() dict

Serializes the UpdateResponse into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) UpdateResponse

Deserializes the UpdateResponse from a dictionary.

class databricks.sdk.service.billing.WrappedBudget
budget: Budget

Budget configuration to be created.

budget_id: str | None = None

Budget ID

as_dict() dict

Serializes the WrappedBudget into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) WrappedBudget

Deserializes the WrappedBudget from a dictionary.

class databricks.sdk.service.billing.WrappedBudgetWithStatus
budget: BudgetWithStatus

Budget configuration with daily status.

as_dict() dict

Serializes the WrappedBudgetWithStatus into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) WrappedBudgetWithStatus

Deserializes the WrappedBudgetWithStatus from a dictionary.

class databricks.sdk.service.billing.WrappedCreateLogDeliveryConfiguration
log_delivery_configuration: CreateLogDeliveryConfigurationParams | None = None
as_dict() dict

Serializes the WrappedCreateLogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) WrappedCreateLogDeliveryConfiguration

Deserializes the WrappedCreateLogDeliveryConfiguration from a dictionary.

class databricks.sdk.service.billing.WrappedLogDeliveryConfiguration
log_delivery_configuration: LogDeliveryConfiguration | None = None
as_dict() dict

Serializes the WrappedLogDeliveryConfiguration into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) WrappedLogDeliveryConfiguration

Deserializes the WrappedLogDeliveryConfiguration from a dictionary.

class databricks.sdk.service.billing.WrappedLogDeliveryConfigurations
log_delivery_configurations: List[LogDeliveryConfiguration] | None = None
as_dict() dict

Serializes the WrappedLogDeliveryConfigurations into a dictionary suitable for use as a JSON request body.

classmethod from_dict(d: Dict[str, any]) WrappedLogDeliveryConfigurations

Deserializes the WrappedLogDeliveryConfigurations from a dictionary.