settings

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 27

Documentation

Overview

These APIs allow you to manage Account Ip Access Lists, Account Settings, Automatic Cluster Update, Compliance Security Profile, Credentials Manager, Csp Enablement Account, Default Namespace, Enhanced Security Monitoring, Esm Enablement Account, Ip Access Lists, Network Connectivity, Personal Compute, Restrict Workspace Admins, Settings, Token Management, Tokens, Workspace Conf, etc.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountIpAccessListsAPI

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

The Accounts IP Access List API enables account admins to configure IP access lists for access to the account console.

Account IP Access Lists affect web application access and REST API access to the account console and account APIs. If the feature is disabled for the account, all access is allowed for this account. There is support for allow lists (inclusion) and block lists (exclusion).

When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.

If there is at least one allow list for the account, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the account, all IP addresses are allowed.

For all allow lists and block lists combined, the account supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.

After changes to the account-level IP access lists, it can take a few minutes for changes to take effect.

func NewAccountIpAccessLists

func NewAccountIpAccessLists(client *client.DatabricksClient) *AccountIpAccessListsAPI

func (*AccountIpAccessListsAPI) Create

Create access list.

Creates an IP access list for the account.

A list can be an allow list or a block list. See the top of this file for a description of how the server treats allow lists and block lists at runtime.

When creating or updating an IP access list:

* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the new list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.

It can take a few minutes for the changes to take effect.

func (*AccountIpAccessListsAPI) Delete

Delete access list.

Deletes an IP access list, specified by its list ID.

func (*AccountIpAccessListsAPI) DeleteByIpAccessListId

func (a *AccountIpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error

Delete access list.

Deletes an IP access list, specified by its list ID.

func (*AccountIpAccessListsAPI) Get

Get IP access list.

Gets an IP access list, specified by its list ID.

func (*AccountIpAccessListsAPI) GetByIpAccessListId

func (a *AccountIpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*GetIpAccessListResponse, error)

Get IP access list.

Gets an IP access list, specified by its list ID.

func (*AccountIpAccessListsAPI) GetByLabel

func (a *AccountIpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)

GetByLabel calls AccountIpAccessListsAPI.IpAccessListInfoLabelToListIdMap and returns a single IpAccessListInfo.

Returns an error if there's more than one IpAccessListInfo with the same .Label.

Note: All IpAccessListInfo instances are loaded into memory before returning matching by name.

This method is generated by Databricks SDK Code Generator.

func (*AccountIpAccessListsAPI) Impl

Impl returns low-level AccountIpAccessLists API implementation Deprecated: use MockAccountIpAccessListsInterface instead.

func (*AccountIpAccessListsAPI) IpAccessListInfoLabelToListIdMap

func (a *AccountIpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)

IpAccessListInfoLabelToListIdMap calls AccountIpAccessListsAPI.ListAll and creates a map of results with IpAccessListInfo.Label as key and IpAccessListInfo.ListId as value.

Returns an error if there's more than one IpAccessListInfo with the same .Label.

Note: All IpAccessListInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*AccountIpAccessListsAPI) List added in v0.24.0

Get access lists.

Gets all IP access lists for the specified account.

This method is generated by Databricks SDK Code Generator.

func (*AccountIpAccessListsAPI) ListAll

Get access lists.

Gets all IP access lists for the specified account.

This method is generated by Databricks SDK Code Generator.

func (*AccountIpAccessListsAPI) Replace

Replace access list.

Replaces an IP access list, specified by its ID.

A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time. When replacing an IP access list: * For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the resulting list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`. It can take a few minutes for the changes to take effect.

func (*AccountIpAccessListsAPI) Update

Update access list.

Updates an existing IP access list, specified by its ID.

A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time.

When updating an IP access list:

* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the updated list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.

It can take a few minutes for the changes to take effect.

func (*AccountIpAccessListsAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockAccountIpAccessListsInterface instead.

type AccountIpAccessListsInterface added in v0.29.0

type AccountIpAccessListsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockAccountIpAccessListsInterface instead.
	WithImpl(impl AccountIpAccessListsService) AccountIpAccessListsInterface

	// Impl returns low-level AccountIpAccessLists API implementation
	// Deprecated: use MockAccountIpAccessListsInterface instead.
	Impl() AccountIpAccessListsService

	// Create access list.
	//
	// Creates an IP access list for the account.
	//
	// A list can be an allow list or a block list. See the top of this file for a
	// description of how the server treats allow lists and block lists at runtime.
	//
	// When creating or updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a maximum of
	// 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to
	// exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`.
	// * If the new list would block the calling user's current IP, error 400 is
	// returned with `error_code` value `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect.
	Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)

	// Delete access list.
	//
	// Deletes an IP access list, specified by its list ID.
	Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error

	// Delete access list.
	//
	// Deletes an IP access list, specified by its list ID.
	DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error

	// Get IP access list.
	//
	// Gets an IP access list, specified by its list ID.
	Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error)

	// Get IP access list.
	//
	// Gets an IP access list, specified by its list ID.
	GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*GetIpAccessListResponse, error)

	// Get access lists.
	//
	// Gets all IP access lists for the specified account.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context) listing.Iterator[IpAccessListInfo]

	// Get access lists.
	//
	// Gets all IP access lists for the specified account.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context) ([]IpAccessListInfo, error)

	// IpAccessListInfoLabelToListIdMap calls [AccountIpAccessListsAPI.ListAll] and creates a map of results with [IpAccessListInfo].Label as key and [IpAccessListInfo].ListId as value.
	//
	// Returns an error if there's more than one [IpAccessListInfo] with the same .Label.
	//
	// Note: All [IpAccessListInfo] instances are loaded into memory before creating a map.
	//
	// This method is generated by Databricks SDK Code Generator.
	IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)

	// GetByLabel calls [AccountIpAccessListsAPI.IpAccessListInfoLabelToListIdMap] and returns a single [IpAccessListInfo].
	//
	// Returns an error if there's more than one [IpAccessListInfo] with the same .Label.
	//
	// Note: All [IpAccessListInfo] instances are loaded into memory before returning matching by name.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)

	// Replace access list.
	//
	// Replaces an IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file for
	// a description of how the server treats allow lists and block lists at run
	// time. When replacing an IP access list: * For all allow lists and block lists
	// combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR
	// counts as a single value. Attempts to exceed that number return error 400
	// with `error_code` value `QUOTA_EXCEEDED`. * If the resulting list would block
	// the calling user's current IP, error 400 is returned with `error_code` value
	// `INVALID_STATE`. It can take a few minutes for the changes to take effect.
	Replace(ctx context.Context, request ReplaceIpAccessList) error

	// Update access list.
	//
	// Updates an existing IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file for
	// a description of how the server treats allow lists and block lists at run
	// time.
	//
	// When updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a maximum of
	// 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to
	// exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`.
	// * If the updated list would block the calling user's current IP, error 400 is
	// returned with `error_code` value `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect.
	Update(ctx context.Context, request UpdateIpAccessList) error
}

type AccountIpAccessListsService

type AccountIpAccessListsService interface {

	// Create access list.
	//
	// Creates an IP access list for the account.
	//
	// A list can be an allow list or a block list. See the top of this file for
	// a description of how the server treats allow lists and block lists at
	// runtime.
	//
	// When creating or updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a
	// maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
	// Attempts to exceed that number return error 400 with `error_code` value
	// `QUOTA_EXCEEDED`. * If the new list would block the calling user's
	// current IP, error 400 is returned with `error_code` value
	// `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect.
	Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)

	// Delete access list.
	//
	// Deletes an IP access list, specified by its list ID.
	Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error

	// Get IP access list.
	//
	// Gets an IP access list, specified by its list ID.
	Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error)

	// Get access lists.
	//
	// Gets all IP access lists for the specified account.
	//
	// Use ListAll() to get all IpAccessListInfo instances
	List(ctx context.Context) (*GetIpAccessListsResponse, error)

	// Replace access list.
	//
	// Replaces an IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file
	// for a description of how the server treats allow lists and block lists at
	// run time. When replacing an IP access list: * For all allow lists and
	// block lists combined, the API supports a maximum of 1000 IP/CIDR values,
	// where one CIDR counts as a single value. Attempts to exceed that number
	// return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the
	// resulting list would block the calling user's current IP, error 400 is
	// returned with `error_code` value `INVALID_STATE`. It can take a few
	// minutes for the changes to take effect.
	Replace(ctx context.Context, request ReplaceIpAccessList) error

	// Update access list.
	//
	// Updates an existing IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file
	// for a description of how the server treats allow lists and block lists at
	// run time.
	//
	// When updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a
	// maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
	// Attempts to exceed that number return error 400 with `error_code` value
	// `QUOTA_EXCEEDED`. * If the updated list would block the calling user's
	// current IP, error 400 is returned with `error_code` value
	// `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect.
	Update(ctx context.Context, request UpdateIpAccessList) error
}

The Accounts IP Access List API enables account admins to configure IP access lists for access to the account console.

Account IP Access Lists affect web application access and REST API access to the account console and account APIs. If the feature is disabled for the account, all access is allowed for this account. There is support for allow lists (inclusion) and block lists (exclusion).

When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.

If there is at least one allow list for the account, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the account, all IP addresses are allowed.

For all allow lists and block lists combined, the account supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.

After changes to the account-level IP access lists, it can take a few minutes for changes to take effect.

type AccountSettingsAPI added in v0.10.0

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

Accounts Settings API allows users to manage settings at the account level.

func NewAccountSettings added in v0.10.0

func NewAccountSettings(client *client.DatabricksClient) *AccountSettingsAPI

func (*AccountSettingsAPI) CspEnablementAccount added in v0.34.0

func (a *AccountSettingsAPI) CspEnablementAccount() CspEnablementAccountInterface

func (*AccountSettingsAPI) EsmEnablementAccount added in v0.34.0

func (a *AccountSettingsAPI) EsmEnablementAccount() EsmEnablementAccountInterface

func (*AccountSettingsAPI) Impl added in v0.10.0

Impl returns low-level AccountSettings API implementation Deprecated: use MockAccountSettingsInterface instead.

func (*AccountSettingsAPI) PersonalCompute added in v0.34.0

func (a *AccountSettingsAPI) PersonalCompute() PersonalComputeInterface

func (*AccountSettingsAPI) WithImpl added in v0.10.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockAccountSettingsInterface instead.

type AccountSettingsInterface added in v0.29.0

type AccountSettingsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockAccountSettingsInterface instead.
	WithImpl(impl AccountSettingsService) AccountSettingsInterface

	// Impl returns low-level AccountSettings API implementation
	// Deprecated: use MockAccountSettingsInterface instead.
	Impl() AccountSettingsService

	// The compliance security profile settings at the account level control
	// whether to enable it for new workspaces. By default, this account-level
	// setting is disabled for new workspaces. After workspace creation, account
	// admins can enable the compliance security profile individually for each
	// workspace.
	//
	// This settings can be disabled so that new workspaces do not have
	// compliance security profile enabled by default.
	CspEnablementAccount() CspEnablementAccountInterface

	// The enhanced security monitoring setting at the account level controls
	// whether to enable the feature on new workspaces. By default, this
	// account-level setting is disabled for new workspaces. After workspace
	// creation, account admins can enable enhanced security monitoring
	// individually for each workspace.
	EsmEnablementAccount() EsmEnablementAccountInterface

	// The Personal Compute enablement setting lets you control which users can
	// use the Personal Compute default policy to create compute resources. By
	// default all users in all workspaces have access (ON), but you can change
	// the setting to instead let individual workspaces configure access control
	// (DELEGATE).
	//
	// There is only one instance of this setting per account. Since this
	// setting has a default value, this setting is present on all accounts even
	// though it's never set on a given account. Deletion reverts the value of
	// the setting back to the default value.
	PersonalCompute() PersonalComputeInterface
}

type AccountSettingsService added in v0.10.0

type AccountSettingsService interface {
}

Accounts Settings API allows users to manage settings at the account level.

type AutomaticClusterUpdateAPI added in v0.34.0

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

Controls whether automatic cluster update is enabled for the current workspace. By default, it is turned off.

func NewAutomaticClusterUpdate added in v0.34.0

func NewAutomaticClusterUpdate(client *client.DatabricksClient) *AutomaticClusterUpdateAPI

func (*AutomaticClusterUpdateAPI) Get added in v0.34.0

Get the automatic cluster update setting.

Gets the automatic cluster update setting.

func (*AutomaticClusterUpdateAPI) Impl added in v0.34.0

Impl returns low-level AutomaticClusterUpdate API implementation Deprecated: use MockAutomaticClusterUpdateInterface instead.

func (*AutomaticClusterUpdateAPI) Update added in v0.34.0

Update the automatic cluster update setting.

Updates the automatic cluster update setting for the workspace. A fresh etag needs to be provided in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET` request before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*AutomaticClusterUpdateAPI) WithImpl added in v0.34.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockAutomaticClusterUpdateInterface instead.

type AutomaticClusterUpdateInterface added in v0.34.0

type AutomaticClusterUpdateInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockAutomaticClusterUpdateInterface instead.
	WithImpl(impl AutomaticClusterUpdateService) AutomaticClusterUpdateInterface

	// Impl returns low-level AutomaticClusterUpdate API implementation
	// Deprecated: use MockAutomaticClusterUpdateInterface instead.
	Impl() AutomaticClusterUpdateService

	// Get the automatic cluster update setting.
	//
	// Gets the automatic cluster update setting.
	Get(ctx context.Context, request GetAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error)

	// Update the automatic cluster update setting.
	//
	// Updates the automatic cluster update setting for the workspace. A fresh etag
	// needs to be provided in `PATCH` requests (as part of the setting field). The
	// etag can be retrieved by making a `GET` request before the `PATCH` request.
	// If the setting is updated concurrently, `PATCH` fails with 409 and the
	// request must be retried by using the fresh etag in the 409 response.
	Update(ctx context.Context, request UpdateAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error)
}

type AutomaticClusterUpdateService added in v0.34.0

type AutomaticClusterUpdateService interface {

	// Get the automatic cluster update setting.
	//
	// Gets the automatic cluster update setting.
	Get(ctx context.Context, request GetAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error)

	// Update the automatic cluster update setting.
	//
	// Updates the automatic cluster update setting for the workspace. A fresh
	// etag needs to be provided in `PATCH` requests (as part of the setting
	// field). The etag can be retrieved by making a `GET` request before the
	// `PATCH` request. If the setting is updated concurrently, `PATCH` fails
	// with 409 and the request must be retried by using the fresh etag in the
	// 409 response.
	Update(ctx context.Context, request UpdateAutomaticClusterUpdateSettingRequest) (*AutomaticClusterUpdateSetting, error)
}

Controls whether automatic cluster update is enabled for the current workspace. By default, it is turned off.

type AutomaticClusterUpdateSetting added in v0.34.0

type AutomaticClusterUpdateSetting struct {
	AutomaticClusterUpdateWorkspace ClusterAutoRestartMessage `json:"automatic_cluster_update_workspace"`
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (AutomaticClusterUpdateSetting) MarshalJSON added in v0.34.0

func (s AutomaticClusterUpdateSetting) MarshalJSON() ([]byte, error)

func (*AutomaticClusterUpdateSetting) UnmarshalJSON added in v0.34.0

func (s *AutomaticClusterUpdateSetting) UnmarshalJSON(b []byte) error

type ClusterAutoRestartMessage added in v0.34.0

type ClusterAutoRestartMessage struct {
	CanToggle bool `json:"can_toggle,omitempty"`

	Enabled bool `json:"enabled,omitempty"`
	// Contains an information about the enablement status judging (e.g. whether
	// the enterprise tier is enabled) This is only additional information that
	// MUST NOT be used to decide whether the setting is enabled or not. This is
	// intended to use only for purposes like showing an error message to the
	// customer with the additional details. For example, using these details we
	// can check why exactly the feature is disabled for this customer.
	EnablementDetails *ClusterAutoRestartMessageEnablementDetails `json:"enablement_details,omitempty"`

	MaintenanceWindow *ClusterAutoRestartMessageMaintenanceWindow `json:"maintenance_window,omitempty"`

	RestartEvenIfNoUpdatesAvailable bool `json:"restart_even_if_no_updates_available,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ClusterAutoRestartMessage) MarshalJSON added in v0.34.0

func (s ClusterAutoRestartMessage) MarshalJSON() ([]byte, error)

func (*ClusterAutoRestartMessage) UnmarshalJSON added in v0.34.0

func (s *ClusterAutoRestartMessage) UnmarshalJSON(b []byte) error

type ClusterAutoRestartMessageEnablementDetails added in v0.34.0

type ClusterAutoRestartMessageEnablementDetails struct {
	// The feature is force enabled if compliance mode is active
	ForcedForComplianceMode bool `json:"forced_for_compliance_mode,omitempty"`
	// The feature is unavailable if the corresponding entitlement disabled (see
	// getShieldEntitlementEnable)
	UnavailableForDisabledEntitlement bool `json:"unavailable_for_disabled_entitlement,omitempty"`
	// The feature is unavailable if the customer doesn't have enterprise tier
	UnavailableForNonEnterpriseTier bool `json:"unavailable_for_non_enterprise_tier,omitempty"`

	ForceSendFields []string `json:"-"`
}

Contains an information about the enablement status judging (e.g. whether the enterprise tier is enabled) This is only additional information that MUST NOT be used to decide whether the setting is enabled or not. This is intended to use only for purposes like showing an error message to the customer with the additional details. For example, using these details we can check why exactly the feature is disabled for this customer.

func (ClusterAutoRestartMessageEnablementDetails) MarshalJSON added in v0.34.0

func (*ClusterAutoRestartMessageEnablementDetails) UnmarshalJSON added in v0.34.0

type ClusterAutoRestartMessageMaintenanceWindow added in v0.34.0

type ClusterAutoRestartMessageMaintenanceWindow struct {
	WeekDayBasedSchedule *ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule `json:"week_day_based_schedule,omitempty"`
}

type ClusterAutoRestartMessageMaintenanceWindowDayOfWeek added in v0.34.0

type ClusterAutoRestartMessageMaintenanceWindowDayOfWeek string
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekDayOfWeekUnspecified ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `DAY_OF_WEEK_UNSPECIFIED`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekFriday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `FRIDAY`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekMonday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `MONDAY`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekSaturday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `SATURDAY`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekSunday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `SUNDAY`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekThursday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `THURSDAY`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekTuesday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `TUESDAY`
const ClusterAutoRestartMessageMaintenanceWindowDayOfWeekWednesday ClusterAutoRestartMessageMaintenanceWindowDayOfWeek = `WEDNESDAY`

func (*ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) Set added in v0.34.0

Set raw string value and validate it against allowed values

func (*ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) String added in v0.34.0

String representation for fmt.Print

func (*ClusterAutoRestartMessageMaintenanceWindowDayOfWeek) Type added in v0.34.0

Type always returns ClusterAutoRestartMessageMaintenanceWindowDayOfWeek to satisfy [pflag.Value] interface

type ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule added in v0.34.0

type ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule struct {
	DayOfWeek ClusterAutoRestartMessageMaintenanceWindowDayOfWeek `json:"day_of_week,omitempty"`

	Frequency ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency `json:"frequency,omitempty"`

	WindowStartTime *ClusterAutoRestartMessageMaintenanceWindowWindowStartTime `json:"window_start_time,omitempty"`
}

type ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency added in v0.34.0

type ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency string
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyEveryWeek ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `EVERY_WEEK`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyFirstAndThirdOfMonth ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `FIRST_AND_THIRD_OF_MONTH`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyFirstOfMonth ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `FIRST_OF_MONTH`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyFourthOfMonth ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `FOURTH_OF_MONTH`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencySecondAndFourthOfMonth ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `SECOND_AND_FOURTH_OF_MONTH`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencySecondOfMonth ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `SECOND_OF_MONTH`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyThirdOfMonth ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `THIRD_OF_MONTH`
const ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequencyWeekDayFrequencyUnspecified ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency = `WEEK_DAY_FREQUENCY_UNSPECIFIED`

func (*ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) Set added in v0.34.0

Set raw string value and validate it against allowed values

func (*ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) String added in v0.34.0

String representation for fmt.Print

func (*ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency) Type added in v0.34.0

Type always returns ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency to satisfy [pflag.Value] interface

type ClusterAutoRestartMessageMaintenanceWindowWindowStartTime added in v0.34.0

type ClusterAutoRestartMessageMaintenanceWindowWindowStartTime struct {
	Hours int `json:"hours,omitempty"`

	Minutes int `json:"minutes,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) MarshalJSON added in v0.34.0

func (*ClusterAutoRestartMessageMaintenanceWindowWindowStartTime) UnmarshalJSON added in v0.34.0

type ComplianceSecurityProfile added in v0.40.0

type ComplianceSecurityProfile struct {
	// Set by customers when they request Compliance Security Profile (CSP)
	ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"`

	IsEnabled bool `json:"is_enabled,omitempty"`

	ForceSendFields []string `json:"-"`
}

SHIELD feature: CSP

func (ComplianceSecurityProfile) MarshalJSON added in v0.40.0

func (s ComplianceSecurityProfile) MarshalJSON() ([]byte, error)

func (*ComplianceSecurityProfile) UnmarshalJSON added in v0.40.0

func (s *ComplianceSecurityProfile) UnmarshalJSON(b []byte) error

type ComplianceSecurityProfileAPI added in v0.40.0

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

Controls whether to enable the compliance security profile for the current workspace. Enabling it on a workspace is permanent. By default, it is turned off.

This settings can NOT be disabled once it is enabled.

func NewComplianceSecurityProfile added in v0.40.0

func NewComplianceSecurityProfile(client *client.DatabricksClient) *ComplianceSecurityProfileAPI

func (*ComplianceSecurityProfileAPI) Get added in v0.40.0

Get the compliance security profile setting.

Gets the compliance security profile setting.

func (*ComplianceSecurityProfileAPI) Impl added in v0.40.0

Impl returns low-level ComplianceSecurityProfile API implementation Deprecated: use MockComplianceSecurityProfileInterface instead.

func (*ComplianceSecurityProfileAPI) Update added in v0.40.0

Update the compliance security profile setting.

Updates the compliance security profile setting for the workspace. A fresh etag needs to be provided in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET` request before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*ComplianceSecurityProfileAPI) WithImpl added in v0.40.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockComplianceSecurityProfileInterface instead.

type ComplianceSecurityProfileInterface added in v0.40.0

type ComplianceSecurityProfileInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockComplianceSecurityProfileInterface instead.
	WithImpl(impl ComplianceSecurityProfileService) ComplianceSecurityProfileInterface

	// Impl returns low-level ComplianceSecurityProfile API implementation
	// Deprecated: use MockComplianceSecurityProfileInterface instead.
	Impl() ComplianceSecurityProfileService

	// Get the compliance security profile setting.
	//
	// Gets the compliance security profile setting.
	Get(ctx context.Context, request GetComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error)

	// Update the compliance security profile setting.
	//
	// Updates the compliance security profile setting for the workspace. A fresh
	// etag needs to be provided in `PATCH` requests (as part of the setting field).
	// The etag can be retrieved by making a `GET` request before the `PATCH`
	// request. If the setting is updated concurrently, `PATCH` fails with 409 and
	// the request must be retried by using the fresh etag in the 409 response.
	Update(ctx context.Context, request UpdateComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error)
}

type ComplianceSecurityProfileService added in v0.40.0

type ComplianceSecurityProfileService interface {

	// Get the compliance security profile setting.
	//
	// Gets the compliance security profile setting.
	Get(ctx context.Context, request GetComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error)

	// Update the compliance security profile setting.
	//
	// Updates the compliance security profile setting for the workspace. A
	// fresh etag needs to be provided in `PATCH` requests (as part of the
	// setting field). The etag can be retrieved by making a `GET` request
	// before the `PATCH` request. If the setting is updated concurrently,
	// `PATCH` fails with 409 and the request must be retried by using the fresh
	// etag in the 409 response.
	Update(ctx context.Context, request UpdateComplianceSecurityProfileSettingRequest) (*ComplianceSecurityProfileSetting, error)
}

Controls whether to enable the compliance security profile for the current workspace. Enabling it on a workspace is permanent. By default, it is turned off.

This settings can NOT be disabled once it is enabled.

type ComplianceSecurityProfileSetting added in v0.40.0

type ComplianceSecurityProfileSetting struct {
	// SHIELD feature: CSP
	ComplianceSecurityProfileWorkspace ComplianceSecurityProfile `json:"compliance_security_profile_workspace"`
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ComplianceSecurityProfileSetting) MarshalJSON added in v0.40.0

func (s ComplianceSecurityProfileSetting) MarshalJSON() ([]byte, error)

func (*ComplianceSecurityProfileSetting) UnmarshalJSON added in v0.40.0

func (s *ComplianceSecurityProfileSetting) UnmarshalJSON(b []byte) error

type ComplianceStandard added in v0.34.0

type ComplianceStandard string

Compliance stardard for SHIELD customers

const ComplianceStandardComplianceStandardUnspecified ComplianceStandard = `COMPLIANCE_STANDARD_UNSPECIFIED`
const ComplianceStandardFedrampHigh ComplianceStandard = `FEDRAMP_HIGH`
const ComplianceStandardFedrampIl5 ComplianceStandard = `FEDRAMP_IL5`
const ComplianceStandardFedrampModerate ComplianceStandard = `FEDRAMP_MODERATE`
const ComplianceStandardHipaa ComplianceStandard = `HIPAA`
const ComplianceStandardIrapProtected ComplianceStandard = `IRAP_PROTECTED`
const ComplianceStandardItarEar ComplianceStandard = `ITAR_EAR`
const ComplianceStandardNone ComplianceStandard = `NONE`
const ComplianceStandardPciDss ComplianceStandard = `PCI_DSS`

func (*ComplianceStandard) Set added in v0.34.0

func (f *ComplianceStandard) Set(v string) error

Set raw string value and validate it against allowed values

func (*ComplianceStandard) String added in v0.34.0

func (f *ComplianceStandard) String() string

String representation for fmt.Print

func (*ComplianceStandard) Type added in v0.34.0

func (f *ComplianceStandard) Type() string

Type always returns ComplianceStandard to satisfy [pflag.Value] interface

type CreateIpAccessList

type CreateIpAccessList struct {
	IpAddresses []string `json:"ip_addresses,omitempty"`
	// Label for the IP access list. This **cannot** be empty.
	Label string `json:"label"`
	// Type of IP access list. Valid values are as follows and are
	// case-sensitive:
	//
	// * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block
	// list. Exclude this IP or range. IP addresses in the block list are
	// excluded even if they are included in an allow list.
	ListType ListType `json:"list_type"`
}

Details required to configure a block list or allow list.

type CreateIpAccessListResponse

type CreateIpAccessListResponse struct {
	// Definition of an IP Access list
	IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}

An IP access list was successfully created.

type CreateNetworkConnectivityConfigRequest added in v0.25.0

type CreateNetworkConnectivityConfigRequest struct {
	// The name of the network connectivity configuration. The name can contain
	// alphanumeric characters, hyphens, and underscores. The length must be
	// between 3 and 30 characters. The name must match the regular expression
	// `^[0-9a-zA-Z-_]{3,30}$`.
	Name string `json:"name"`
	// The region for the network connectivity configuration. Only workspaces in
	// the same region can be attached to the network connectivity
	// configuration.
	Region string `json:"region"`
}

type CreateOboTokenRequest

type CreateOboTokenRequest struct {
	// Application ID of the service principal.
	ApplicationId string `json:"application_id"`
	// Comment that describes the purpose of the token.
	Comment string `json:"comment,omitempty"`
	// The number of seconds before the token expires.
	LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"`

	ForceSendFields []string `json:"-"`
}

Configuration details for creating on-behalf tokens.

func (CreateOboTokenRequest) MarshalJSON added in v0.23.0

func (s CreateOboTokenRequest) MarshalJSON() ([]byte, error)

func (*CreateOboTokenRequest) UnmarshalJSON added in v0.23.0

func (s *CreateOboTokenRequest) UnmarshalJSON(b []byte) error

type CreateOboTokenResponse

type CreateOboTokenResponse struct {
	TokenInfo *TokenInfo `json:"token_info,omitempty"`
	// Value of the token.
	TokenValue string `json:"token_value,omitempty"`

	ForceSendFields []string `json:"-"`
}

An on-behalf token was successfully created for the service principal.

func (CreateOboTokenResponse) MarshalJSON added in v0.23.0

func (s CreateOboTokenResponse) MarshalJSON() ([]byte, error)

func (*CreateOboTokenResponse) UnmarshalJSON added in v0.23.0

func (s *CreateOboTokenResponse) UnmarshalJSON(b []byte) error

type CreatePrivateEndpointRuleRequest added in v0.25.0

type CreatePrivateEndpointRuleRequest struct {
	// The sub-resource type (group ID) of the target resource. Note that to
	// connect to workspace root storage (root DBFS), you need two endpoints,
	// one for `blob` and one for `dfs`.
	GroupId CreatePrivateEndpointRuleRequestGroupId `json:"group_id"`
	// Your Network Connectvity Configuration ID.
	NetworkConnectivityConfigId string `json:"-" url:"-"`
	// The Azure resource ID of the target resource.
	ResourceId string `json:"resource_id"`
}

type CreatePrivateEndpointRuleRequestGroupId added in v0.25.0

type CreatePrivateEndpointRuleRequestGroupId string

The sub-resource type (group ID) of the target resource. Note that to connect to workspace root storage (root DBFS), you need two endpoints, one for `blob` and one for `dfs`.

const CreatePrivateEndpointRuleRequestGroupIdBlob CreatePrivateEndpointRuleRequestGroupId = `blob`
const CreatePrivateEndpointRuleRequestGroupIdDfs CreatePrivateEndpointRuleRequestGroupId = `dfs`
const CreatePrivateEndpointRuleRequestGroupIdMysqlServer CreatePrivateEndpointRuleRequestGroupId = `mysqlServer`
const CreatePrivateEndpointRuleRequestGroupIdSqlServer CreatePrivateEndpointRuleRequestGroupId = `sqlServer`

func (*CreatePrivateEndpointRuleRequestGroupId) Set added in v0.25.0

Set raw string value and validate it against allowed values

func (*CreatePrivateEndpointRuleRequestGroupId) String added in v0.25.0

String representation for fmt.Print

func (*CreatePrivateEndpointRuleRequestGroupId) Type added in v0.25.0

Type always returns CreatePrivateEndpointRuleRequestGroupId to satisfy [pflag.Value] interface

type CreateTokenRequest

type CreateTokenRequest struct {
	// Optional description to attach to the token.
	Comment string `json:"comment,omitempty"`
	// The lifetime of the token, in seconds.
	//
	// If the lifetime is not specified, this token remains valid indefinitely.
	LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateTokenRequest) MarshalJSON added in v0.23.0

func (s CreateTokenRequest) MarshalJSON() ([]byte, error)

func (*CreateTokenRequest) UnmarshalJSON added in v0.23.0

func (s *CreateTokenRequest) UnmarshalJSON(b []byte) error

type CreateTokenResponse

type CreateTokenResponse struct {
	// The information for the new token.
	TokenInfo *PublicTokenInfo `json:"token_info,omitempty"`
	// The value of the new token.
	TokenValue string `json:"token_value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateTokenResponse) MarshalJSON added in v0.23.0

func (s CreateTokenResponse) MarshalJSON() ([]byte, error)

func (*CreateTokenResponse) UnmarshalJSON added in v0.23.0

func (s *CreateTokenResponse) UnmarshalJSON(b []byte) error

type CredentialsManagerAPI added in v0.20.0

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

Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens.

func NewCredentialsManager added in v0.20.0

func NewCredentialsManager(client *client.DatabricksClient) *CredentialsManagerAPI

func (*CredentialsManagerAPI) ExchangeToken added in v0.20.0

Exchange token.

Exchange tokens with an Identity Provider to get a new access token. It allows specifying scopes to determine token permissions.

func (*CredentialsManagerAPI) Impl added in v0.20.0

Impl returns low-level CredentialsManager API implementation Deprecated: use MockCredentialsManagerInterface instead.

func (*CredentialsManagerAPI) WithImpl added in v0.20.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockCredentialsManagerInterface instead.

type CredentialsManagerInterface added in v0.29.0

type CredentialsManagerInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockCredentialsManagerInterface instead.
	WithImpl(impl CredentialsManagerService) CredentialsManagerInterface

	// Impl returns low-level CredentialsManager API implementation
	// Deprecated: use MockCredentialsManagerInterface instead.
	Impl() CredentialsManagerService

	// Exchange token.
	//
	// Exchange tokens with an Identity Provider to get a new access token. It
	// allows specifying scopes to determine token permissions.
	ExchangeToken(ctx context.Context, request ExchangeTokenRequest) (*ExchangeTokenResponse, error)
}

type CredentialsManagerService added in v0.20.0

type CredentialsManagerService interface {

	// Exchange token.
	//
	// Exchange tokens with an Identity Provider to get a new access token. It
	// allows specifying scopes to determine token permissions.
	ExchangeToken(ctx context.Context, request ExchangeTokenRequest) (*ExchangeTokenResponse, error)
}

Credentials manager interacts with with Identity Providers to to perform token exchanges using stored credentials and refresh tokens.

type CspEnablementAccount added in v0.34.0

type CspEnablementAccount struct {
	// Set by customers when they request Compliance Security Profile (CSP)
	// Invariants are enforced in Settings policy.
	ComplianceStandards []ComplianceStandard `json:"compliance_standards,omitempty"`
	// Enforced = it cannot be overriden at workspace level.
	IsEnforced bool `json:"is_enforced,omitempty"`

	ForceSendFields []string `json:"-"`
}

Account level policy for CSP

func (CspEnablementAccount) MarshalJSON added in v0.34.0

func (s CspEnablementAccount) MarshalJSON() ([]byte, error)

func (*CspEnablementAccount) UnmarshalJSON added in v0.34.0

func (s *CspEnablementAccount) UnmarshalJSON(b []byte) error

type CspEnablementAccountAPI added in v0.34.0

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

The compliance security profile settings at the account level control whether to enable it for new workspaces. By default, this account-level setting is disabled for new workspaces. After workspace creation, account admins can enable the compliance security profile individually for each workspace.

This settings can be disabled so that new workspaces do not have compliance security profile enabled by default.

func NewCspEnablementAccount added in v0.34.0

func NewCspEnablementAccount(client *client.DatabricksClient) *CspEnablementAccountAPI

func (*CspEnablementAccountAPI) Get added in v0.34.0

Get the compliance security profile setting for new workspaces.

Gets the compliance security profile setting for new workspaces.

func (*CspEnablementAccountAPI) Impl added in v0.34.0

Impl returns low-level CspEnablementAccount API implementation Deprecated: use MockCspEnablementAccountInterface instead.

func (*CspEnablementAccountAPI) Update added in v0.34.0

Update the compliance security profile setting for new workspaces.

Updates the value of the compliance security profile setting for new workspaces.

func (*CspEnablementAccountAPI) WithImpl added in v0.34.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockCspEnablementAccountInterface instead.

type CspEnablementAccountInterface added in v0.34.0

type CspEnablementAccountInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockCspEnablementAccountInterface instead.
	WithImpl(impl CspEnablementAccountService) CspEnablementAccountInterface

	// Impl returns low-level CspEnablementAccount API implementation
	// Deprecated: use MockCspEnablementAccountInterface instead.
	Impl() CspEnablementAccountService

	// Get the compliance security profile setting for new workspaces.
	//
	// Gets the compliance security profile setting for new workspaces.
	Get(ctx context.Context, request GetCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error)

	// Update the compliance security profile setting for new workspaces.
	//
	// Updates the value of the compliance security profile setting for new
	// workspaces.
	Update(ctx context.Context, request UpdateCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error)
}

type CspEnablementAccountService added in v0.34.0

type CspEnablementAccountService interface {

	// Get the compliance security profile setting for new workspaces.
	//
	// Gets the compliance security profile setting for new workspaces.
	Get(ctx context.Context, request GetCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error)

	// Update the compliance security profile setting for new workspaces.
	//
	// Updates the value of the compliance security profile setting for new
	// workspaces.
	Update(ctx context.Context, request UpdateCspEnablementAccountSettingRequest) (*CspEnablementAccountSetting, error)
}

The compliance security profile settings at the account level control whether to enable it for new workspaces. By default, this account-level setting is disabled for new workspaces. After workspace creation, account admins can enable the compliance security profile individually for each workspace.

This settings can be disabled so that new workspaces do not have compliance security profile enabled by default.

type CspEnablementAccountSetting added in v0.34.0

type CspEnablementAccountSetting struct {
	// Account level policy for CSP
	CspEnablementAccount CspEnablementAccount `json:"csp_enablement_account"`
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CspEnablementAccountSetting) MarshalJSON added in v0.34.0

func (s CspEnablementAccountSetting) MarshalJSON() ([]byte, error)

func (*CspEnablementAccountSetting) UnmarshalJSON added in v0.34.0

func (s *CspEnablementAccountSetting) UnmarshalJSON(b []byte) error

type DefaultNamespaceAPI added in v0.34.0

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

The default namespace setting API allows users to configure the default namespace for a Databricks workspace.

Through this API, users can retrieve, set, or modify the default namespace used when queries do not reference a fully qualified three-level name. For example, if you use the API to set 'retail_prod' as the default catalog, then a query 'SELECT * FROM myTable' would reference the object 'retail_prod.default.myTable' (the schema 'default' is always assumed).

This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only applies when using Unity Catalog-enabled compute.

func NewDefaultNamespace added in v0.34.0

func NewDefaultNamespace(client *client.DatabricksClient) *DefaultNamespaceAPI

func (*DefaultNamespaceAPI) Delete added in v0.34.0

Delete the default namespace setting.

Deletes the default namespace setting for the workspace. A fresh etag needs to be provided in `DELETE` requests (as a query parameter). The etag can be retrieved by making a `GET` request before the `DELETE` request. If the setting is updated/deleted concurrently, `DELETE` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*DefaultNamespaceAPI) Get added in v0.34.0

Get the default namespace setting.

Gets the default namespace setting.

func (*DefaultNamespaceAPI) Impl added in v0.34.0

Impl returns low-level DefaultNamespace API implementation Deprecated: use MockDefaultNamespaceInterface instead.

func (*DefaultNamespaceAPI) Update added in v0.34.0

Update the default namespace setting.

Updates the default namespace setting for the workspace. A fresh etag needs to be provided in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET` request before the `PATCH` request. Note that if the setting does not exist, `GET` returns a NOT_FOUND error and the etag is present in the error response, which should be set in the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*DefaultNamespaceAPI) WithImpl added in v0.34.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockDefaultNamespaceInterface instead.

type DefaultNamespaceInterface added in v0.34.0

type DefaultNamespaceInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockDefaultNamespaceInterface instead.
	WithImpl(impl DefaultNamespaceService) DefaultNamespaceInterface

	// Impl returns low-level DefaultNamespace API implementation
	// Deprecated: use MockDefaultNamespaceInterface instead.
	Impl() DefaultNamespaceService

	// Delete the default namespace setting.
	//
	// Deletes the default namespace setting for the workspace. A fresh etag needs
	// to be provided in `DELETE` requests (as a query parameter). The etag can be
	// retrieved by making a `GET` request before the `DELETE` request. If the
	// setting is updated/deleted concurrently, `DELETE` fails with 409 and the
	// request must be retried by using the fresh etag in the 409 response.
	Delete(ctx context.Context, request DeleteDefaultNamespaceSettingRequest) (*DeleteDefaultNamespaceSettingResponse, error)

	// Get the default namespace setting.
	//
	// Gets the default namespace setting.
	Get(ctx context.Context, request GetDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error)

	// Update the default namespace setting.
	//
	// Updates the default namespace setting for the workspace. A fresh etag needs
	// to be provided in `PATCH` requests (as part of the setting field). The etag
	// can be retrieved by making a `GET` request before the `PATCH` request. Note
	// that if the setting does not exist, `GET` returns a NOT_FOUND error and the
	// etag is present in the error response, which should be set in the `PATCH`
	// request. If the setting is updated concurrently, `PATCH` fails with 409 and
	// the request must be retried by using the fresh etag in the 409 response.
	Update(ctx context.Context, request UpdateDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error)
}

type DefaultNamespaceService added in v0.34.0

type DefaultNamespaceService interface {

	// Delete the default namespace setting.
	//
	// Deletes the default namespace setting for the workspace. A fresh etag
	// needs to be provided in `DELETE` requests (as a query parameter). The
	// etag can be retrieved by making a `GET` request before the `DELETE`
	// request. If the setting is updated/deleted concurrently, `DELETE` fails
	// with 409 and the request must be retried by using the fresh etag in the
	// 409 response.
	Delete(ctx context.Context, request DeleteDefaultNamespaceSettingRequest) (*DeleteDefaultNamespaceSettingResponse, error)

	// Get the default namespace setting.
	//
	// Gets the default namespace setting.
	Get(ctx context.Context, request GetDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error)

	// Update the default namespace setting.
	//
	// Updates the default namespace setting for the workspace. A fresh etag
	// needs to be provided in `PATCH` requests (as part of the setting field).
	// The etag can be retrieved by making a `GET` request before the `PATCH`
	// request. Note that if the setting does not exist, `GET` returns a
	// NOT_FOUND error and the etag is present in the error response, which
	// should be set in the `PATCH` request. If the setting is updated
	// concurrently, `PATCH` fails with 409 and the request must be retried by
	// using the fresh etag in the 409 response.
	Update(ctx context.Context, request UpdateDefaultNamespaceSettingRequest) (*DefaultNamespaceSetting, error)
}

The default namespace setting API allows users to configure the default namespace for a Databricks workspace.

Through this API, users can retrieve, set, or modify the default namespace used when queries do not reference a fully qualified three-level name. For example, if you use the API to set 'retail_prod' as the default catalog, then a query 'SELECT * FROM myTable' would reference the object 'retail_prod.default.myTable' (the schema 'default' is always assumed).

This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only applies when using Unity Catalog-enabled compute.

type DefaultNamespaceSetting added in v0.21.0

type DefaultNamespaceSetting struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`

	Namespace StringMessage `json:"namespace"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

This represents the setting configuration for the default namespace in the Databricks workspace. Setting the default catalog for the workspace determines the catalog that is used when queries do not reference a fully qualified 3 level name. For example, if the default catalog is set to 'retail_prod' then a query 'SELECT * FROM myTable' would reference the object 'retail_prod.default.myTable' (the schema 'default' is always assumed). This setting requires a restart of clusters and SQL warehouses to take effect. Additionally, the default namespace only applies when using Unity Catalog-enabled compute.

func (DefaultNamespaceSetting) MarshalJSON added in v0.23.0

func (s DefaultNamespaceSetting) MarshalJSON() ([]byte, error)

func (*DefaultNamespaceSetting) UnmarshalJSON added in v0.23.0

func (s *DefaultNamespaceSetting) UnmarshalJSON(b []byte) error

type DeleteAccountIpAccessListRequest

type DeleteAccountIpAccessListRequest struct {
	// The ID for the corresponding IP access list
	IpAccessListId string `json:"-" url:"-"`
}

Delete access list

type DeleteDefaultNamespaceSettingRequest added in v0.31.0

type DeleteDefaultNamespaceSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Delete the default namespace setting

func (DeleteDefaultNamespaceSettingRequest) MarshalJSON added in v0.31.0

func (s DeleteDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error)

func (*DeleteDefaultNamespaceSettingRequest) UnmarshalJSON added in v0.31.0

func (s *DeleteDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error

type DeleteDefaultNamespaceSettingResponse added in v0.31.0

type DeleteDefaultNamespaceSettingResponse struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"etag"`
}

The etag is returned.

type DeleteIpAccessListRequest

type DeleteIpAccessListRequest struct {
	// The ID for the corresponding IP access list
	IpAccessListId string `json:"-" url:"-"`
}

Delete access list

type DeleteNetworkConnectivityConfigurationRequest added in v0.25.0

type DeleteNetworkConnectivityConfigurationRequest struct {
	// Your Network Connectvity Configuration ID.
	NetworkConnectivityConfigId string `json:"-" url:"-"`
}

Delete a network connectivity configuration

type DeleteNetworkConnectivityConfigurationResponse added in v0.34.0

type DeleteNetworkConnectivityConfigurationResponse struct {
}

type DeletePersonalComputeSettingRequest added in v0.11.0

type DeletePersonalComputeSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Delete Personal Compute setting

func (DeletePersonalComputeSettingRequest) MarshalJSON added in v0.31.0

func (s DeletePersonalComputeSettingRequest) MarshalJSON() ([]byte, error)

func (*DeletePersonalComputeSettingRequest) UnmarshalJSON added in v0.31.0

func (s *DeletePersonalComputeSettingRequest) UnmarshalJSON(b []byte) error

type DeletePersonalComputeSettingResponse added in v0.11.0

type DeletePersonalComputeSettingResponse struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"etag"`
}

The etag is returned.

type DeletePrivateEndpointRuleRequest added in v0.25.0

type DeletePrivateEndpointRuleRequest struct {
	// Your Network Connectvity Configuration ID.
	NetworkConnectivityConfigId string `json:"-" url:"-"`
	// Your private endpoint rule ID.
	PrivateEndpointRuleId string `json:"-" url:"-"`
}

Delete a private endpoint rule

type DeleteResponse added in v0.34.0

type DeleteResponse struct {
}

type DeleteRestrictWorkspaceAdminsSettingRequest added in v0.31.0

type DeleteRestrictWorkspaceAdminsSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Delete the restrict workspace admins setting

func (DeleteRestrictWorkspaceAdminsSettingRequest) MarshalJSON added in v0.31.0

func (*DeleteRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON added in v0.31.0

type DeleteRestrictWorkspaceAdminsSettingResponse added in v0.31.0

type DeleteRestrictWorkspaceAdminsSettingResponse struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"etag"`
}

The etag is returned.

type DeleteTokenManagementRequest

type DeleteTokenManagementRequest struct {
	// The ID of the token to get.
	TokenId string `json:"-" url:"-"`
}

Delete a token

type EnhancedSecurityMonitoring added in v0.40.0

type EnhancedSecurityMonitoring struct {
	IsEnabled bool `json:"is_enabled,omitempty"`

	ForceSendFields []string `json:"-"`
}

SHIELD feature: ESM

func (EnhancedSecurityMonitoring) MarshalJSON added in v0.40.0

func (s EnhancedSecurityMonitoring) MarshalJSON() ([]byte, error)

func (*EnhancedSecurityMonitoring) UnmarshalJSON added in v0.40.0

func (s *EnhancedSecurityMonitoring) UnmarshalJSON(b []byte) error

type EnhancedSecurityMonitoringAPI added in v0.40.0

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

Controls whether enhanced security monitoring is enabled for the current workspace. If the compliance security profile is enabled, this is automatically enabled. By default, it is disabled. However, if the compliance security profile is enabled, this is automatically enabled.

If the compliance security profile is disabled, you can enable or disable this setting and it is not permanent.

func NewEnhancedSecurityMonitoring added in v0.40.0

func NewEnhancedSecurityMonitoring(client *client.DatabricksClient) *EnhancedSecurityMonitoringAPI

func (*EnhancedSecurityMonitoringAPI) Get added in v0.40.0

Get the enhanced security monitoring setting.

Gets the enhanced security monitoring setting.

func (*EnhancedSecurityMonitoringAPI) Impl added in v0.40.0

Impl returns low-level EnhancedSecurityMonitoring API implementation Deprecated: use MockEnhancedSecurityMonitoringInterface instead.

func (*EnhancedSecurityMonitoringAPI) Update added in v0.40.0

Update the enhanced security monitoring setting.

Updates the enhanced security monitoring setting for the workspace. A fresh etag needs to be provided in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a `GET` request before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*EnhancedSecurityMonitoringAPI) WithImpl added in v0.40.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockEnhancedSecurityMonitoringInterface instead.

type EnhancedSecurityMonitoringInterface added in v0.40.0

type EnhancedSecurityMonitoringInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockEnhancedSecurityMonitoringInterface instead.
	WithImpl(impl EnhancedSecurityMonitoringService) EnhancedSecurityMonitoringInterface

	// Impl returns low-level EnhancedSecurityMonitoring API implementation
	// Deprecated: use MockEnhancedSecurityMonitoringInterface instead.
	Impl() EnhancedSecurityMonitoringService

	// Get the enhanced security monitoring setting.
	//
	// Gets the enhanced security monitoring setting.
	Get(ctx context.Context, request GetEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error)

	// Update the enhanced security monitoring setting.
	//
	// Updates the enhanced security monitoring setting for the workspace. A fresh
	// etag needs to be provided in `PATCH` requests (as part of the setting field).
	// The etag can be retrieved by making a `GET` request before the `PATCH`
	// request. If the setting is updated concurrently, `PATCH` fails with 409 and
	// the request must be retried by using the fresh etag in the 409 response.
	Update(ctx context.Context, request UpdateEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error)
}

type EnhancedSecurityMonitoringService added in v0.40.0

type EnhancedSecurityMonitoringService interface {

	// Get the enhanced security monitoring setting.
	//
	// Gets the enhanced security monitoring setting.
	Get(ctx context.Context, request GetEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error)

	// Update the enhanced security monitoring setting.
	//
	// Updates the enhanced security monitoring setting for the workspace. A
	// fresh etag needs to be provided in `PATCH` requests (as part of the
	// setting field). The etag can be retrieved by making a `GET` request
	// before the `PATCH` request. If the setting is updated concurrently,
	// `PATCH` fails with 409 and the request must be retried by using the fresh
	// etag in the 409 response.
	Update(ctx context.Context, request UpdateEnhancedSecurityMonitoringSettingRequest) (*EnhancedSecurityMonitoringSetting, error)
}

Controls whether enhanced security monitoring is enabled for the current workspace. If the compliance security profile is enabled, this is automatically enabled. By default, it is disabled. However, if the compliance security profile is enabled, this is automatically enabled.

If the compliance security profile is disabled, you can enable or disable this setting and it is not permanent.

type EnhancedSecurityMonitoringSetting added in v0.40.0

type EnhancedSecurityMonitoringSetting struct {
	// SHIELD feature: ESM
	EnhancedSecurityMonitoringWorkspace EnhancedSecurityMonitoring `json:"enhanced_security_monitoring_workspace"`
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (EnhancedSecurityMonitoringSetting) MarshalJSON added in v0.40.0

func (s EnhancedSecurityMonitoringSetting) MarshalJSON() ([]byte, error)

func (*EnhancedSecurityMonitoringSetting) UnmarshalJSON added in v0.40.0

func (s *EnhancedSecurityMonitoringSetting) UnmarshalJSON(b []byte) error

type EsmEnablementAccount added in v0.34.0

type EsmEnablementAccount struct {
	IsEnforced bool `json:"is_enforced,omitempty"`

	ForceSendFields []string `json:"-"`
}

Account level policy for ESM

func (EsmEnablementAccount) MarshalJSON added in v0.34.0

func (s EsmEnablementAccount) MarshalJSON() ([]byte, error)

func (*EsmEnablementAccount) UnmarshalJSON added in v0.34.0

func (s *EsmEnablementAccount) UnmarshalJSON(b []byte) error

type EsmEnablementAccountAPI added in v0.34.0

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

The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces. By default, this account-level setting is disabled for new workspaces. After workspace creation, account admins can enable enhanced security monitoring individually for each workspace.

func NewEsmEnablementAccount added in v0.34.0

func NewEsmEnablementAccount(client *client.DatabricksClient) *EsmEnablementAccountAPI

func (*EsmEnablementAccountAPI) Get added in v0.34.0

Get the enhanced security monitoring setting for new workspaces.

Gets the enhanced security monitoring setting for new workspaces.

func (*EsmEnablementAccountAPI) Impl added in v0.34.0

Impl returns low-level EsmEnablementAccount API implementation Deprecated: use MockEsmEnablementAccountInterface instead.

func (*EsmEnablementAccountAPI) Update added in v0.34.0

Update the enhanced security monitoring setting for new workspaces.

Updates the value of the enhanced security monitoring setting for new workspaces.

func (*EsmEnablementAccountAPI) WithImpl added in v0.34.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockEsmEnablementAccountInterface instead.

type EsmEnablementAccountInterface added in v0.34.0

type EsmEnablementAccountInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockEsmEnablementAccountInterface instead.
	WithImpl(impl EsmEnablementAccountService) EsmEnablementAccountInterface

	// Impl returns low-level EsmEnablementAccount API implementation
	// Deprecated: use MockEsmEnablementAccountInterface instead.
	Impl() EsmEnablementAccountService

	// Get the enhanced security monitoring setting for new workspaces.
	//
	// Gets the enhanced security monitoring setting for new workspaces.
	Get(ctx context.Context, request GetEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error)

	// Update the enhanced security monitoring setting for new workspaces.
	//
	// Updates the value of the enhanced security monitoring setting for new
	// workspaces.
	Update(ctx context.Context, request UpdateEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error)
}

type EsmEnablementAccountService added in v0.34.0

type EsmEnablementAccountService interface {

	// Get the enhanced security monitoring setting for new workspaces.
	//
	// Gets the enhanced security monitoring setting for new workspaces.
	Get(ctx context.Context, request GetEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error)

	// Update the enhanced security monitoring setting for new workspaces.
	//
	// Updates the value of the enhanced security monitoring setting for new
	// workspaces.
	Update(ctx context.Context, request UpdateEsmEnablementAccountSettingRequest) (*EsmEnablementAccountSetting, error)
}

The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces. By default, this account-level setting is disabled for new workspaces. After workspace creation, account admins can enable enhanced security monitoring individually for each workspace.

type EsmEnablementAccountSetting added in v0.34.0

type EsmEnablementAccountSetting struct {
	// Account level policy for ESM
	EsmEnablementAccount EsmEnablementAccount `json:"esm_enablement_account"`
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (EsmEnablementAccountSetting) MarshalJSON added in v0.34.0

func (s EsmEnablementAccountSetting) MarshalJSON() ([]byte, error)

func (*EsmEnablementAccountSetting) UnmarshalJSON added in v0.34.0

func (s *EsmEnablementAccountSetting) UnmarshalJSON(b []byte) error

type ExchangeToken added in v0.20.0

type ExchangeToken struct {
	// The requested token.
	Credential string `json:"credential,omitempty"`
	// The end-of-life timestamp of the token. The value is in milliseconds
	// since the Unix epoch.
	CredentialEolTime int64 `json:"credentialEolTime,omitempty"`
	// User ID of the user that owns this token.
	OwnerId int64 `json:"ownerId,omitempty"`
	// The scopes of access granted in the token.
	Scopes []string `json:"scopes,omitempty"`
	// The type of this exchange token
	TokenType TokenType `json:"tokenType,omitempty"`

	ForceSendFields []string `json:"-"`
}

The exchange token is the result of the token exchange with the IdP

func (ExchangeToken) MarshalJSON added in v0.23.0

func (s ExchangeToken) MarshalJSON() ([]byte, error)

func (*ExchangeToken) UnmarshalJSON added in v0.23.0

func (s *ExchangeToken) UnmarshalJSON(b []byte) error

type ExchangeTokenRequest added in v0.20.0

type ExchangeTokenRequest struct {
	// The partition of Credentials store
	PartitionId PartitionId `json:"partitionId"`
	// Array of scopes for the token request.
	Scopes []string `json:"scopes"`
	// A list of token types being requested
	TokenType []TokenType `json:"tokenType"`
}

Exchange a token with the IdP

type ExchangeTokenResponse added in v0.20.0

type ExchangeTokenResponse struct {
	Values []ExchangeToken `json:"values,omitempty"`
}

Exhanged tokens were successfully returned.

type FetchIpAccessListResponse

type FetchIpAccessListResponse struct {
	// Definition of an IP Access list
	IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}

An IP access list was successfully returned.

type GetAccountIpAccessListRequest

type GetAccountIpAccessListRequest struct {
	// The ID for the corresponding IP access list
	IpAccessListId string `json:"-" url:"-"`
}

Get IP access list

type GetAutomaticClusterUpdateSettingRequest added in v0.36.0

type GetAutomaticClusterUpdateSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the automatic cluster update setting

func (GetAutomaticClusterUpdateSettingRequest) MarshalJSON added in v0.36.0

func (s GetAutomaticClusterUpdateSettingRequest) MarshalJSON() ([]byte, error)

func (*GetAutomaticClusterUpdateSettingRequest) UnmarshalJSON added in v0.36.0

func (s *GetAutomaticClusterUpdateSettingRequest) UnmarshalJSON(b []byte) error

type GetComplianceSecurityProfileSettingRequest added in v0.40.0

type GetComplianceSecurityProfileSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the compliance security profile setting

func (GetComplianceSecurityProfileSettingRequest) MarshalJSON added in v0.40.0

func (*GetComplianceSecurityProfileSettingRequest) UnmarshalJSON added in v0.40.0

type GetCspEnablementAccountSettingRequest added in v0.36.0

type GetCspEnablementAccountSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the compliance security profile setting for new workspaces

func (GetCspEnablementAccountSettingRequest) MarshalJSON added in v0.36.0

func (s GetCspEnablementAccountSettingRequest) MarshalJSON() ([]byte, error)

func (*GetCspEnablementAccountSettingRequest) UnmarshalJSON added in v0.36.0

func (s *GetCspEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error

type GetDefaultNamespaceSettingRequest added in v0.31.0

type GetDefaultNamespaceSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the default namespace setting

func (GetDefaultNamespaceSettingRequest) MarshalJSON added in v0.31.0

func (s GetDefaultNamespaceSettingRequest) MarshalJSON() ([]byte, error)

func (*GetDefaultNamespaceSettingRequest) UnmarshalJSON added in v0.31.0

func (s *GetDefaultNamespaceSettingRequest) UnmarshalJSON(b []byte) error

type GetEnhancedSecurityMonitoringSettingRequest added in v0.40.0

type GetEnhancedSecurityMonitoringSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the enhanced security monitoring setting

func (GetEnhancedSecurityMonitoringSettingRequest) MarshalJSON added in v0.40.0

func (*GetEnhancedSecurityMonitoringSettingRequest) UnmarshalJSON added in v0.40.0

type GetEsmEnablementAccountSettingRequest added in v0.36.0

type GetEsmEnablementAccountSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the enhanced security monitoring setting for new workspaces

func (GetEsmEnablementAccountSettingRequest) MarshalJSON added in v0.36.0

func (s GetEsmEnablementAccountSettingRequest) MarshalJSON() ([]byte, error)

func (*GetEsmEnablementAccountSettingRequest) UnmarshalJSON added in v0.36.0

func (s *GetEsmEnablementAccountSettingRequest) UnmarshalJSON(b []byte) error

type GetIpAccessListRequest

type GetIpAccessListRequest struct {
	// The ID for the corresponding IP access list
	IpAccessListId string `json:"-" url:"-"`
}

Get access list

type GetIpAccessListResponse

type GetIpAccessListResponse struct {
	// Definition of an IP Access list
	IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}

type GetIpAccessListsResponse

type GetIpAccessListsResponse struct {
	IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}

IP access lists were successfully returned.

type GetNetworkConnectivityConfigurationRequest added in v0.25.0

type GetNetworkConnectivityConfigurationRequest struct {
	// Your Network Connectvity Configuration ID.
	NetworkConnectivityConfigId string `json:"-" url:"-"`
}

Get a network connectivity configuration

type GetPersonalComputeSettingRequest added in v0.31.0

type GetPersonalComputeSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get Personal Compute setting

func (GetPersonalComputeSettingRequest) MarshalJSON added in v0.31.0

func (s GetPersonalComputeSettingRequest) MarshalJSON() ([]byte, error)

func (*GetPersonalComputeSettingRequest) UnmarshalJSON added in v0.31.0

func (s *GetPersonalComputeSettingRequest) UnmarshalJSON(b []byte) error

type GetPrivateEndpointRuleRequest added in v0.25.0

type GetPrivateEndpointRuleRequest struct {
	// Your Network Connectvity Configuration ID.
	NetworkConnectivityConfigId string `json:"-" url:"-"`
	// Your private endpoint rule ID.
	PrivateEndpointRuleId string `json:"-" url:"-"`
}

Get a private endpoint rule

type GetRestrictWorkspaceAdminsSettingRequest added in v0.31.0

type GetRestrictWorkspaceAdminsSettingRequest struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// delete pattern to perform setting deletions in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// DELETE request to identify the rule set version you are deleting.
	Etag string `json:"-" url:"etag,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get the restrict workspace admins setting

func (GetRestrictWorkspaceAdminsSettingRequest) MarshalJSON added in v0.31.0

func (*GetRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON added in v0.31.0

func (s *GetRestrictWorkspaceAdminsSettingRequest) UnmarshalJSON(b []byte) error

type GetStatusRequest

type GetStatusRequest struct {
	Keys string `json:"-" url:"keys"`
}

Check configuration status

type GetTokenManagementRequest

type GetTokenManagementRequest struct {
	// The ID of the token to get.
	TokenId string `json:"-" url:"-"`
}

Get token info

type GetTokenPermissionLevelsResponse added in v0.15.0

type GetTokenPermissionLevelsResponse struct {
	// Specific permission levels
	PermissionLevels []TokenPermissionsDescription `json:"permission_levels,omitempty"`
}

type GetTokenResponse added in v0.30.0

type GetTokenResponse struct {
	TokenInfo *TokenInfo `json:"token_info,omitempty"`
}

Token with specified Token ID was successfully returned.

type IpAccessListInfo

type IpAccessListInfo struct {
	// Total number of IP or CIDR values.
	AddressCount int `json:"address_count,omitempty"`
	// Creation timestamp in milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// User ID of the user who created this list.
	CreatedBy int64 `json:"created_by,omitempty"`
	// Specifies whether this IP access list is enabled.
	Enabled bool `json:"enabled,omitempty"`

	IpAddresses []string `json:"ip_addresses,omitempty"`
	// Label for the IP access list. This **cannot** be empty.
	Label string `json:"label,omitempty"`
	// Universally unique identifier (UUID) of the IP access list.
	ListId string `json:"list_id,omitempty"`
	// Type of IP access list. Valid values are as follows and are
	// case-sensitive:
	//
	// * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block
	// list. Exclude this IP or range. IP addresses in the block list are
	// excluded even if they are included in an allow list.
	ListType ListType `json:"list_type,omitempty"`
	// Update timestamp in milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// User ID of the user who updated this list.
	UpdatedBy int64 `json:"updated_by,omitempty"`

	ForceSendFields []string `json:"-"`
}

Definition of an IP Access list

func (IpAccessListInfo) MarshalJSON added in v0.23.0

func (s IpAccessListInfo) MarshalJSON() ([]byte, error)

func (*IpAccessListInfo) UnmarshalJSON added in v0.23.0

func (s *IpAccessListInfo) UnmarshalJSON(b []byte) error

type IpAccessListsAPI

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

IP Access List enables admins to configure IP access lists.

IP access lists affect web application access and REST API access to this workspace only. If the feature is disabled for a workspace, all access is allowed for this workspace. There is support for allow lists (inclusion) and block lists (exclusion).

When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.

If there is at least one allow list for the workspace, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the workspace, all IP addresses are allowed.

For all allow lists and block lists combined, the workspace supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.

After changes to the IP access list feature, it can take a few minutes for changes to take effect.

func NewIpAccessLists

func NewIpAccessLists(client *client.DatabricksClient) *IpAccessListsAPI

func (*IpAccessListsAPI) Create

Create access list.

Creates an IP access list for this workspace.

A list can be an allow list or a block list. See the top of this file for a description of how the server treats allow lists and block lists at runtime.

When creating or updating an IP access list:

* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the new list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.

It can take a few minutes for the changes to take effect. **Note**: Your new IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus

Example (IpAccessLists)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.IpAccessLists.Create(ctx, settings.CreateIpAccessList{
	Label:       fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	IpAddresses: []string{"1.0.0.0/16"},
	ListType:    settings.ListTypeBlock,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

// cleanup

err = w.IpAccessLists.DeleteByIpAccessListId(ctx, created.IpAccessList.ListId)
if err != nil {
	panic(err)
}
Output:

func (*IpAccessListsAPI) Delete

Delete access list.

Deletes an IP access list, specified by its list ID.

func (*IpAccessListsAPI) DeleteByIpAccessListId

func (a *IpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error

Delete access list.

Deletes an IP access list, specified by its list ID.

func (*IpAccessListsAPI) Get

Get access list.

Gets an IP access list, specified by its list ID.

Example (IpAccessLists)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.IpAccessLists.Create(ctx, settings.CreateIpAccessList{
	Label:       fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	IpAddresses: []string{"1.0.0.0/16"},
	ListType:    settings.ListTypeBlock,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

byId, err := w.IpAccessLists.GetByIpAccessListId(ctx, created.IpAccessList.ListId)
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", byId)

// cleanup

err = w.IpAccessLists.DeleteByIpAccessListId(ctx, created.IpAccessList.ListId)
if err != nil {
	panic(err)
}
Output:

func (*IpAccessListsAPI) GetByIpAccessListId

func (a *IpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*FetchIpAccessListResponse, error)

Get access list.

Gets an IP access list, specified by its list ID.

func (*IpAccessListsAPI) GetByLabel

func (a *IpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)

GetByLabel calls IpAccessListsAPI.IpAccessListInfoLabelToListIdMap and returns a single IpAccessListInfo.

Returns an error if there's more than one IpAccessListInfo with the same .Label.

Note: All IpAccessListInfo instances are loaded into memory before returning matching by name.

This method is generated by Databricks SDK Code Generator.

func (*IpAccessListsAPI) Impl

Impl returns low-level IpAccessLists API implementation Deprecated: use MockIpAccessListsInterface instead.

func (*IpAccessListsAPI) IpAccessListInfoLabelToListIdMap

func (a *IpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)

IpAccessListInfoLabelToListIdMap calls IpAccessListsAPI.ListAll and creates a map of results with IpAccessListInfo.Label as key and IpAccessListInfo.ListId as value.

Returns an error if there's more than one IpAccessListInfo with the same .Label.

Note: All IpAccessListInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*IpAccessListsAPI) List added in v0.24.0

Get access lists.

Gets all IP access lists for the specified workspace.

This method is generated by Databricks SDK Code Generator.

func (*IpAccessListsAPI) ListAll

func (a *IpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)

Get access lists.

Gets all IP access lists for the specified workspace.

This method is generated by Databricks SDK Code Generator.

Example (IpAccessLists)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.IpAccessLists.ListAll(ctx)
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*IpAccessListsAPI) Replace

func (a *IpAccessListsAPI) Replace(ctx context.Context, request ReplaceIpAccessList) error

Replace access list.

Replaces an IP access list, specified by its ID.

A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time. When replacing an IP access list: * For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the resulting list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`. It can take a few minutes for the changes to take effect. Note that your resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.

Example (IpAccessLists)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.IpAccessLists.Create(ctx, settings.CreateIpAccessList{
	Label:       fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	IpAddresses: []string{"1.0.0.0/16"},
	ListType:    settings.ListTypeBlock,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

err = w.IpAccessLists.Replace(ctx, settings.ReplaceIpAccessList{
	IpAccessListId: created.IpAccessList.ListId,
	Label:          fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	IpAddresses:    []string{"1.0.0.0/24"},
	ListType:       settings.ListTypeBlock,
	Enabled:        false,
})
if err != nil {
	panic(err)
}

// cleanup

err = w.IpAccessLists.DeleteByIpAccessListId(ctx, created.IpAccessList.ListId)
if err != nil {
	panic(err)
}
Output:

func (*IpAccessListsAPI) Update

func (a *IpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error

Update access list.

Updates an existing IP access list, specified by its ID.

A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time.

When updating an IP access list:

* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the updated list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.

It can take a few minutes for the changes to take effect. Note that your resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.

func (*IpAccessListsAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockIpAccessListsInterface instead.

type IpAccessListsInterface added in v0.29.0

type IpAccessListsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockIpAccessListsInterface instead.
	WithImpl(impl IpAccessListsService) IpAccessListsInterface

	// Impl returns low-level IpAccessLists API implementation
	// Deprecated: use MockIpAccessListsInterface instead.
	Impl() IpAccessListsService

	// Create access list.
	//
	// Creates an IP access list for this workspace.
	//
	// A list can be an allow list or a block list. See the top of this file for a
	// description of how the server treats allow lists and block lists at runtime.
	//
	// When creating or updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a maximum of
	// 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to
	// exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`.
	// * If the new list would block the calling user's current IP, error 400 is
	// returned with `error_code` value `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect. **Note**: Your new
	// IP access list has no effect until you enable the feature. See
	// :method:workspaceconf/setStatus
	Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)

	// Delete access list.
	//
	// Deletes an IP access list, specified by its list ID.
	Delete(ctx context.Context, request DeleteIpAccessListRequest) error

	// Delete access list.
	//
	// Deletes an IP access list, specified by its list ID.
	DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error

	// Get access list.
	//
	// Gets an IP access list, specified by its list ID.
	Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error)

	// Get access list.
	//
	// Gets an IP access list, specified by its list ID.
	GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*FetchIpAccessListResponse, error)

	// Get access lists.
	//
	// Gets all IP access lists for the specified workspace.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context) listing.Iterator[IpAccessListInfo]

	// Get access lists.
	//
	// Gets all IP access lists for the specified workspace.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context) ([]IpAccessListInfo, error)

	// IpAccessListInfoLabelToListIdMap calls [IpAccessListsAPI.ListAll] and creates a map of results with [IpAccessListInfo].Label as key and [IpAccessListInfo].ListId as value.
	//
	// Returns an error if there's more than one [IpAccessListInfo] with the same .Label.
	//
	// Note: All [IpAccessListInfo] instances are loaded into memory before creating a map.
	//
	// This method is generated by Databricks SDK Code Generator.
	IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)

	// GetByLabel calls [IpAccessListsAPI.IpAccessListInfoLabelToListIdMap] and returns a single [IpAccessListInfo].
	//
	// Returns an error if there's more than one [IpAccessListInfo] with the same .Label.
	//
	// Note: All [IpAccessListInfo] instances are loaded into memory before returning matching by name.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)

	// Replace access list.
	//
	// Replaces an IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file for
	// a description of how the server treats allow lists and block lists at run
	// time. When replacing an IP access list: * For all allow lists and block lists
	// combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR
	// counts as a single value. Attempts to exceed that number return error 400
	// with `error_code` value `QUOTA_EXCEEDED`. * If the resulting list would block
	// the calling user's current IP, error 400 is returned with `error_code` value
	// `INVALID_STATE`. It can take a few minutes for the changes to take effect.
	// Note that your resulting IP access list has no effect until you enable the
	// feature. See :method:workspaceconf/setStatus.
	Replace(ctx context.Context, request ReplaceIpAccessList) error

	// Update access list.
	//
	// Updates an existing IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file for
	// a description of how the server treats allow lists and block lists at run
	// time.
	//
	// When updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a maximum of
	// 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to
	// exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`.
	// * If the updated list would block the calling user's current IP, error 400 is
	// returned with `error_code` value `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect. Note that your
	// resulting IP access list has no effect until you enable the feature. See
	// :method:workspaceconf/setStatus.
	Update(ctx context.Context, request UpdateIpAccessList) error
}

type IpAccessListsService

type IpAccessListsService interface {

	// Create access list.
	//
	// Creates an IP access list for this workspace.
	//
	// A list can be an allow list or a block list. See the top of this file for
	// a description of how the server treats allow lists and block lists at
	// runtime.
	//
	// When creating or updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a
	// maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
	// Attempts to exceed that number return error 400 with `error_code` value
	// `QUOTA_EXCEEDED`. * If the new list would block the calling user's
	// current IP, error 400 is returned with `error_code` value
	// `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect. **Note**: Your
	// new IP access list has no effect until you enable the feature. See
	// :method:workspaceconf/setStatus
	Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)

	// Delete access list.
	//
	// Deletes an IP access list, specified by its list ID.
	Delete(ctx context.Context, request DeleteIpAccessListRequest) error

	// Get access list.
	//
	// Gets an IP access list, specified by its list ID.
	Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error)

	// Get access lists.
	//
	// Gets all IP access lists for the specified workspace.
	//
	// Use ListAll() to get all IpAccessListInfo instances
	List(ctx context.Context) (*ListIpAccessListResponse, error)

	// Replace access list.
	//
	// Replaces an IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file
	// for a description of how the server treats allow lists and block lists at
	// run time. When replacing an IP access list: * For all allow lists and
	// block lists combined, the API supports a maximum of 1000 IP/CIDR values,
	// where one CIDR counts as a single value. Attempts to exceed that number
	// return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the
	// resulting list would block the calling user's current IP, error 400 is
	// returned with `error_code` value `INVALID_STATE`. It can take a few
	// minutes for the changes to take effect. Note that your resulting IP
	// access list has no effect until you enable the feature. See
	// :method:workspaceconf/setStatus.
	Replace(ctx context.Context, request ReplaceIpAccessList) error

	// Update access list.
	//
	// Updates an existing IP access list, specified by its ID.
	//
	// A list can include allow lists and block lists. See the top of this file
	// for a description of how the server treats allow lists and block lists at
	// run time.
	//
	// When updating an IP access list:
	//
	// * For all allow lists and block lists combined, the API supports a
	// maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
	// Attempts to exceed that number return error 400 with `error_code` value
	// `QUOTA_EXCEEDED`. * If the updated list would block the calling user's
	// current IP, error 400 is returned with `error_code` value
	// `INVALID_STATE`.
	//
	// It can take a few minutes for the changes to take effect. Note that your
	// resulting IP access list has no effect until you enable the feature. See
	// :method:workspaceconf/setStatus.
	Update(ctx context.Context, request UpdateIpAccessList) error
}

IP Access List enables admins to configure IP access lists.

IP access lists affect web application access and REST API access to this workspace only. If the feature is disabled for a workspace, all access is allowed for this workspace. There is support for allow lists (inclusion) and block lists (exclusion).

When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.

If there is at least one allow list for the workspace, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the workspace, all IP addresses are allowed.

For all allow lists and block lists combined, the workspace supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.

After changes to the IP access list feature, it can take a few minutes for changes to take effect.

type ListIpAccessListResponse added in v0.23.0

type ListIpAccessListResponse struct {
	IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}

IP access lists were successfully returned.

type ListNccAzurePrivateEndpointRulesResponse added in v0.26.0

type ListNccAzurePrivateEndpointRulesResponse struct {
	Items []NccAzurePrivateEndpointRule `json:"items,omitempty"`
	// A token that can be used to get the next page of results. If null, there
	// are no more results to show.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ListNccAzurePrivateEndpointRulesResponse) MarshalJSON added in v0.26.0

func (*ListNccAzurePrivateEndpointRulesResponse) UnmarshalJSON added in v0.26.0

func (s *ListNccAzurePrivateEndpointRulesResponse) UnmarshalJSON(b []byte) error

type ListNetworkConnectivityConfigurationsRequest added in v0.26.0

type ListNetworkConnectivityConfigurationsRequest struct {
	// Pagination token to go to next page based on previous query.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

List network connectivity configurations

func (ListNetworkConnectivityConfigurationsRequest) MarshalJSON added in v0.26.0

func (*ListNetworkConnectivityConfigurationsRequest) UnmarshalJSON added in v0.26.0

type ListNetworkConnectivityConfigurationsResponse added in v0.26.0

type ListNetworkConnectivityConfigurationsResponse struct {
	Items []NetworkConnectivityConfiguration `json:"items,omitempty"`
	// A token that can be used to get the next page of results. If null, there
	// are no more results to show.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ListNetworkConnectivityConfigurationsResponse) MarshalJSON added in v0.26.0

func (*ListNetworkConnectivityConfigurationsResponse) UnmarshalJSON added in v0.26.0

type ListPrivateEndpointRulesRequest added in v0.26.0

type ListPrivateEndpointRulesRequest struct {
	// Your Network Connectvity Configuration ID.
	NetworkConnectivityConfigId string `json:"-" url:"-"`
	// Pagination token to go to next page based on previous query.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

List private endpoint rules

func (ListPrivateEndpointRulesRequest) MarshalJSON added in v0.26.0

func (s ListPrivateEndpointRulesRequest) MarshalJSON() ([]byte, error)

func (*ListPrivateEndpointRulesRequest) UnmarshalJSON added in v0.26.0

func (s *ListPrivateEndpointRulesRequest) UnmarshalJSON(b []byte) error

type ListPublicTokensResponse added in v0.29.0

type ListPublicTokensResponse struct {
	// The information for each token.
	TokenInfos []PublicTokenInfo `json:"token_infos,omitempty"`
}

type ListTokenManagementRequest

type ListTokenManagementRequest struct {
	// User ID of the user that created the token.
	CreatedById int64 `json:"-" url:"created_by_id,omitempty"`
	// Username of the user that created the token.
	CreatedByUsername string `json:"-" url:"created_by_username,omitempty"`

	ForceSendFields []string `json:"-"`
}

List all tokens

func (ListTokenManagementRequest) MarshalJSON added in v0.23.0

func (s ListTokenManagementRequest) MarshalJSON() ([]byte, error)

func (*ListTokenManagementRequest) UnmarshalJSON added in v0.23.0

func (s *ListTokenManagementRequest) UnmarshalJSON(b []byte) error

type ListTokensResponse

type ListTokensResponse struct {
	// Token metadata of each user-created token in the workspace
	TokenInfos []TokenInfo `json:"token_infos,omitempty"`
}

Tokens were successfully returned.

type ListType

type ListType string

Type of IP access list. Valid values are as follows and are case-sensitive:

* `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list.

const ListTypeAllow ListType = `ALLOW`

An allow list. Include this IP or range.

const ListTypeBlock ListType = `BLOCK`

A block list. Exclude this IP or range. IP addresses in the block list are excluded even if they are included in an allow list.

func (*ListType) Set

func (f *ListType) Set(v string) error

Set raw string value and validate it against allowed values

func (*ListType) String

func (f *ListType) String() string

String representation for fmt.Print

func (*ListType) Type

func (f *ListType) Type() string

Type always returns ListType to satisfy [pflag.Value] interface

type NccAwsStableIpRule added in v0.34.0

type NccAwsStableIpRule struct {
	// The list of stable IP CIDR blocks from which Databricks network traffic
	// originates when accessing your resources.
	CidrBlocks []string `json:"cidr_blocks,omitempty"`
}

The stable AWS IP CIDR blocks. You can use these to configure the firewall of your resources to allow traffic from your Databricks workspace.

type NccAzurePrivateEndpointRule added in v0.25.0

type NccAzurePrivateEndpointRule struct {
	// The current status of this private endpoint. The private endpoint rules
	// are effective only if the connection state is `ESTABLISHED`. Remember
	// that you must approve new endpoints on your resources in the Azure portal
	// before they take effect.
	//
	// The possible values are: - INIT: (deprecated) The endpoint has been
	// created and pending approval. - PENDING: The endpoint has been created
	// and pending approval. - ESTABLISHED: The endpoint has been approved and
	// is ready to use in your serverless compute resources. - REJECTED:
	// Connection was rejected by the private link resource owner. -
	// DISCONNECTED: Connection was removed by the private link resource owner,
	// the private endpoint becomes informative and should be deleted for
	// clean-up.
	ConnectionState NccAzurePrivateEndpointRuleConnectionState `json:"connection_state,omitempty"`
	// Time in epoch milliseconds when this object was created.
	CreationTime int64 `json:"creation_time,omitempty"`
	// Whether this private endpoint is deactivated.
	Deactivated bool `json:"deactivated,omitempty"`
	// Time in epoch milliseconds when this object was deactivated.
	DeactivatedAt int64 `json:"deactivated_at,omitempty"`
	// The name of the Azure private endpoint resource.
	EndpointName string `json:"endpoint_name,omitempty"`
	// The sub-resource type (group ID) of the target resource. Note that to
	// connect to workspace root storage (root DBFS), you need two endpoints,
	// one for `blob` and one for `dfs`.
	GroupId NccAzurePrivateEndpointRuleGroupId `json:"group_id,omitempty"`
	// The ID of a network connectivity configuration, which is the parent
	// resource of this private endpoint rule object.
	NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"`
	// The Azure resource ID of the target resource.
	ResourceId string `json:"resource_id,omitempty"`
	// The ID of a private endpoint rule.
	RuleId string `json:"rule_id,omitempty"`
	// Time in epoch milliseconds when this object was updated.
	UpdatedTime int64 `json:"updated_time,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (NccAzurePrivateEndpointRule) MarshalJSON added in v0.25.0

func (s NccAzurePrivateEndpointRule) MarshalJSON() ([]byte, error)

func (*NccAzurePrivateEndpointRule) UnmarshalJSON added in v0.25.0

func (s *NccAzurePrivateEndpointRule) UnmarshalJSON(b []byte) error

type NccAzurePrivateEndpointRuleConnectionState added in v0.25.0

type NccAzurePrivateEndpointRuleConnectionState string

The current status of this private endpoint. The private endpoint rules are effective only if the connection state is `ESTABLISHED`. Remember that you must approve new endpoints on your resources in the Azure portal before they take effect.

The possible values are: - INIT: (deprecated) The endpoint has been created and pending approval. - PENDING: The endpoint has been created and pending approval. - ESTABLISHED: The endpoint has been approved and is ready to use in your serverless compute resources. - REJECTED: Connection was rejected by the private link resource owner. - DISCONNECTED: Connection was removed by the private link resource owner, the private endpoint becomes informative and should be deleted for clean-up.

const NccAzurePrivateEndpointRuleConnectionStateDisconnected NccAzurePrivateEndpointRuleConnectionState = `DISCONNECTED`
const NccAzurePrivateEndpointRuleConnectionStateEstablished NccAzurePrivateEndpointRuleConnectionState = `ESTABLISHED`
const NccAzurePrivateEndpointRuleConnectionStateInit NccAzurePrivateEndpointRuleConnectionState = `INIT`
const NccAzurePrivateEndpointRuleConnectionStatePending NccAzurePrivateEndpointRuleConnectionState = `PENDING`
const NccAzurePrivateEndpointRuleConnectionStateRejected NccAzurePrivateEndpointRuleConnectionState = `REJECTED`

func (*NccAzurePrivateEndpointRuleConnectionState) Set added in v0.25.0

Set raw string value and validate it against allowed values

func (*NccAzurePrivateEndpointRuleConnectionState) String added in v0.25.0

String representation for fmt.Print

func (*NccAzurePrivateEndpointRuleConnectionState) Type added in v0.25.0

Type always returns NccAzurePrivateEndpointRuleConnectionState to satisfy [pflag.Value] interface

type NccAzurePrivateEndpointRuleGroupId added in v0.25.0

type NccAzurePrivateEndpointRuleGroupId string

The sub-resource type (group ID) of the target resource. Note that to connect to workspace root storage (root DBFS), you need two endpoints, one for `blob` and one for `dfs`.

const NccAzurePrivateEndpointRuleGroupIdBlob NccAzurePrivateEndpointRuleGroupId = `blob`
const NccAzurePrivateEndpointRuleGroupIdDfs NccAzurePrivateEndpointRuleGroupId = `dfs`
const NccAzurePrivateEndpointRuleGroupIdMysqlServer NccAzurePrivateEndpointRuleGroupId = `mysqlServer`
const NccAzurePrivateEndpointRuleGroupIdSqlServer NccAzurePrivateEndpointRuleGroupId = `sqlServer`

func (*NccAzurePrivateEndpointRuleGroupId) Set added in v0.25.0

Set raw string value and validate it against allowed values

func (*NccAzurePrivateEndpointRuleGroupId) String added in v0.25.0

String representation for fmt.Print

func (*NccAzurePrivateEndpointRuleGroupId) Type added in v0.25.0

Type always returns NccAzurePrivateEndpointRuleGroupId to satisfy [pflag.Value] interface

type NccAzureServiceEndpointRule added in v0.25.0

type NccAzureServiceEndpointRule struct {
	// The list of subnets from which Databricks network traffic originates when
	// accessing your Azure resources.
	Subnets []string `json:"subnets,omitempty"`
	// The Azure region in which this service endpoint rule applies.
	TargetRegion string `json:"target_region,omitempty"`
	// The Azure services to which this service endpoint rule applies to.
	TargetServices []string `json:"target_services,omitempty"`

	ForceSendFields []string `json:"-"`
}

The stable Azure service endpoints. You can configure the firewall of your Azure resources to allow traffic from your Databricks serverless compute resources.

func (NccAzureServiceEndpointRule) MarshalJSON added in v0.25.0

func (s NccAzureServiceEndpointRule) MarshalJSON() ([]byte, error)

func (*NccAzureServiceEndpointRule) UnmarshalJSON added in v0.25.0

func (s *NccAzureServiceEndpointRule) UnmarshalJSON(b []byte) error

type NccEgressConfig added in v0.25.0

type NccEgressConfig struct {
	// The network connectivity rules that are applied by default without
	// resource specific configurations. You can find the stable network
	// information of your serverless compute resources here.
	DefaultRules *NccEgressDefaultRules `json:"default_rules,omitempty"`
	// The network connectivity rules that configured for each destinations.
	// These rules override default rules.
	TargetRules *NccEgressTargetRules `json:"target_rules,omitempty"`
}

The network connectivity rules that apply to network traffic from your serverless compute resources.

type NccEgressDefaultRules added in v0.25.0

type NccEgressDefaultRules struct {
	// The stable AWS IP CIDR blocks. You can use these to configure the
	// firewall of your resources to allow traffic from your Databricks
	// workspace.
	AwsStableIpRule *NccAwsStableIpRule `json:"aws_stable_ip_rule,omitempty"`
	// The stable Azure service endpoints. You can configure the firewall of
	// your Azure resources to allow traffic from your Databricks serverless
	// compute resources.
	AzureServiceEndpointRule *NccAzureServiceEndpointRule `json:"azure_service_endpoint_rule,omitempty"`
}

The network connectivity rules that are applied by default without resource specific configurations. You can find the stable network information of your serverless compute resources here.

type NccEgressTargetRules added in v0.25.0

type NccEgressTargetRules struct {
	AzurePrivateEndpointRules []NccAzurePrivateEndpointRule `json:"azure_private_endpoint_rules,omitempty"`
}

The network connectivity rules that configured for each destinations. These rules override default rules.

type NetworkConnectivityAPI added in v0.25.0

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

These APIs provide configurations for the network connectivity of your workspaces for serverless compute resources.

func NewNetworkConnectivity added in v0.25.0

func NewNetworkConnectivity(client *client.DatabricksClient) *NetworkConnectivityAPI

func (*NetworkConnectivityAPI) CreateNetworkConnectivityConfiguration added in v0.25.0

func (a *NetworkConnectivityAPI) CreateNetworkConnectivityConfiguration(ctx context.Context, request CreateNetworkConnectivityConfigRequest) (*NetworkConnectivityConfiguration, error)

Create a network connectivity configuration.

func (*NetworkConnectivityAPI) CreatePrivateEndpointRule added in v0.25.0

Create a private endpoint rule.

Create a private endpoint rule for the specified network connectivity config object. Once the object is created, Databricks asynchronously provisions a new Azure private endpoint to your specified Azure resource.

**IMPORTANT**: You must use Azure portal or other Azure tools to approve the private endpoint to complete the connection. To get the information of the private endpoint created, make a `GET` request on the new private endpoint rule. See serverless private link.

func (*NetworkConnectivityAPI) DeleteNetworkConnectivityConfiguration added in v0.25.0

func (a *NetworkConnectivityAPI) DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error

Delete a network connectivity configuration.

Deletes a network connectivity configuration.

func (*NetworkConnectivityAPI) DeleteNetworkConnectivityConfigurationByNetworkConnectivityConfigId added in v0.25.0

func (a *NetworkConnectivityAPI) DeleteNetworkConnectivityConfigurationByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) error

Delete a network connectivity configuration.

Deletes a network connectivity configuration.

func (*NetworkConnectivityAPI) DeletePrivateEndpointRule added in v0.25.0

Delete a private endpoint rule.

Initiates deleting a private endpoint rule. If the connection state is PENDING or EXPIRED, the private endpoint is immediately deleted. Otherwise, the private endpoint is deactivated and will be deleted after seven days of deactivation. When a private endpoint is deactivated, the `deactivated` field is set to `true` and the private endpoint is not available to your serverless compute resources.

func (*NetworkConnectivityAPI) DeletePrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId added in v0.25.0

func (a *NetworkConnectivityAPI) DeletePrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId(ctx context.Context, networkConnectivityConfigId string, privateEndpointRuleId string) (*NccAzurePrivateEndpointRule, error)

Delete a private endpoint rule.

Initiates deleting a private endpoint rule. If the connection state is PENDING or EXPIRED, the private endpoint is immediately deleted. Otherwise, the private endpoint is deactivated and will be deleted after seven days of deactivation. When a private endpoint is deactivated, the `deactivated` field is set to `true` and the private endpoint is not available to your serverless compute resources.

func (*NetworkConnectivityAPI) GetNetworkConnectivityConfiguration added in v0.25.0

Get a network connectivity configuration.

Gets a network connectivity configuration.

func (*NetworkConnectivityAPI) GetNetworkConnectivityConfigurationByNetworkConnectivityConfigId added in v0.25.0

func (a *NetworkConnectivityAPI) GetNetworkConnectivityConfigurationByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) (*NetworkConnectivityConfiguration, error)

Get a network connectivity configuration.

Gets a network connectivity configuration.

func (*NetworkConnectivityAPI) GetPrivateEndpointRule added in v0.25.0

Get a private endpoint rule.

Gets the private endpoint rule.

func (*NetworkConnectivityAPI) GetPrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId added in v0.25.0

func (a *NetworkConnectivityAPI) GetPrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId(ctx context.Context, networkConnectivityConfigId string, privateEndpointRuleId string) (*NccAzurePrivateEndpointRule, error)

Get a private endpoint rule.

Gets the private endpoint rule.

func (*NetworkConnectivityAPI) Impl added in v0.25.0

Impl returns low-level NetworkConnectivity API implementation Deprecated: use MockNetworkConnectivityInterface instead.

func (*NetworkConnectivityAPI) ListNetworkConnectivityConfigurations added in v0.26.0

List network connectivity configurations.

Gets an array of network connectivity configurations.

This method is generated by Databricks SDK Code Generator.

func (*NetworkConnectivityAPI) ListNetworkConnectivityConfigurationsAll added in v0.26.0

List network connectivity configurations.

Gets an array of network connectivity configurations.

This method is generated by Databricks SDK Code Generator.

func (*NetworkConnectivityAPI) ListPrivateEndpointRules added in v0.26.0

List private endpoint rules.

Gets an array of private endpoint rules.

This method is generated by Databricks SDK Code Generator.

func (*NetworkConnectivityAPI) ListPrivateEndpointRulesAll added in v0.26.0

List private endpoint rules.

Gets an array of private endpoint rules.

This method is generated by Databricks SDK Code Generator.

func (*NetworkConnectivityAPI) ListPrivateEndpointRulesByNetworkConnectivityConfigId added in v0.26.0

func (a *NetworkConnectivityAPI) ListPrivateEndpointRulesByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) (*ListNccAzurePrivateEndpointRulesResponse, error)

List private endpoint rules.

Gets an array of private endpoint rules.

func (*NetworkConnectivityAPI) WithImpl added in v0.25.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockNetworkConnectivityInterface instead.

type NetworkConnectivityConfiguration added in v0.25.0

type NetworkConnectivityConfiguration struct {
	// The Databricks account ID that hosts the credential.
	AccountId string `json:"account_id,omitempty"`
	// Time in epoch milliseconds when this object was created.
	CreationTime int64 `json:"creation_time,omitempty"`
	// The network connectivity rules that apply to network traffic from your
	// serverless compute resources.
	EgressConfig *NccEgressConfig `json:"egress_config,omitempty"`
	// The name of the network connectivity configuration. The name can contain
	// alphanumeric characters, hyphens, and underscores. The length must be
	// between 3 and 30 characters. The name must match the regular expression
	// `^[0-9a-zA-Z-_]{3,30}$`.
	Name string `json:"name,omitempty"`
	// Databricks network connectivity configuration ID.
	NetworkConnectivityConfigId string `json:"network_connectivity_config_id,omitempty"`
	// The region for the network connectivity configuration. Only workspaces in
	// the same region can be attached to the network connectivity
	// configuration.
	Region string `json:"region,omitempty"`
	// Time in epoch milliseconds when this object was updated.
	UpdatedTime int64 `json:"updated_time,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (NetworkConnectivityConfiguration) MarshalJSON added in v0.25.0

func (s NetworkConnectivityConfiguration) MarshalJSON() ([]byte, error)

func (*NetworkConnectivityConfiguration) UnmarshalJSON added in v0.25.0

func (s *NetworkConnectivityConfiguration) UnmarshalJSON(b []byte) error

type NetworkConnectivityInterface added in v0.29.0

type NetworkConnectivityInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockNetworkConnectivityInterface instead.
	WithImpl(impl NetworkConnectivityService) NetworkConnectivityInterface

	// Impl returns low-level NetworkConnectivity API implementation
	// Deprecated: use MockNetworkConnectivityInterface instead.
	Impl() NetworkConnectivityService

	// Create a network connectivity configuration.
	CreateNetworkConnectivityConfiguration(ctx context.Context, request CreateNetworkConnectivityConfigRequest) (*NetworkConnectivityConfiguration, error)

	// Create a private endpoint rule.
	//
	// Create a private endpoint rule for the specified network connectivity config
	// object. Once the object is created, Databricks asynchronously provisions a
	// new Azure private endpoint to your specified Azure resource.
	//
	// **IMPORTANT**: You must use Azure portal or other Azure tools to approve the
	// private endpoint to complete the connection. To get the information of the
	// private endpoint created, make a `GET` request on the new private endpoint
	// rule. See [serverless private link].
	//
	// [serverless private link]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security/serverless-private-link
	CreatePrivateEndpointRule(ctx context.Context, request CreatePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)

	// Delete a network connectivity configuration.
	//
	// Deletes a network connectivity configuration.
	DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error

	// Delete a network connectivity configuration.
	//
	// Deletes a network connectivity configuration.
	DeleteNetworkConnectivityConfigurationByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) error

	// Delete a private endpoint rule.
	//
	// Initiates deleting a private endpoint rule. If the connection state is
	// PENDING or EXPIRED, the private endpoint is immediately deleted. Otherwise,
	// the private endpoint is deactivated and will be deleted after seven days of
	// deactivation. When a private endpoint is deactivated, the `deactivated` field
	// is set to `true` and the private endpoint is not available to your serverless
	// compute resources.
	DeletePrivateEndpointRule(ctx context.Context, request DeletePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)

	// Delete a private endpoint rule.
	//
	// Initiates deleting a private endpoint rule. If the connection state is
	// PENDING or EXPIRED, the private endpoint is immediately deleted. Otherwise,
	// the private endpoint is deactivated and will be deleted after seven days of
	// deactivation. When a private endpoint is deactivated, the `deactivated` field
	// is set to `true` and the private endpoint is not available to your serverless
	// compute resources.
	DeletePrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId(ctx context.Context, networkConnectivityConfigId string, privateEndpointRuleId string) (*NccAzurePrivateEndpointRule, error)

	// Get a network connectivity configuration.
	//
	// Gets a network connectivity configuration.
	GetNetworkConnectivityConfiguration(ctx context.Context, request GetNetworkConnectivityConfigurationRequest) (*NetworkConnectivityConfiguration, error)

	// Get a network connectivity configuration.
	//
	// Gets a network connectivity configuration.
	GetNetworkConnectivityConfigurationByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) (*NetworkConnectivityConfiguration, error)

	// Get a private endpoint rule.
	//
	// Gets the private endpoint rule.
	GetPrivateEndpointRule(ctx context.Context, request GetPrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)

	// Get a private endpoint rule.
	//
	// Gets the private endpoint rule.
	GetPrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId(ctx context.Context, networkConnectivityConfigId string, privateEndpointRuleId string) (*NccAzurePrivateEndpointRule, error)

	// List network connectivity configurations.
	//
	// Gets an array of network connectivity configurations.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListNetworkConnectivityConfigurations(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) listing.Iterator[NetworkConnectivityConfiguration]

	// List network connectivity configurations.
	//
	// Gets an array of network connectivity configurations.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListNetworkConnectivityConfigurationsAll(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) ([]NetworkConnectivityConfiguration, error)

	// List private endpoint rules.
	//
	// Gets an array of private endpoint rules.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListPrivateEndpointRules(ctx context.Context, request ListPrivateEndpointRulesRequest) listing.Iterator[NccAzurePrivateEndpointRule]

	// List private endpoint rules.
	//
	// Gets an array of private endpoint rules.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListPrivateEndpointRulesAll(ctx context.Context, request ListPrivateEndpointRulesRequest) ([]NccAzurePrivateEndpointRule, error)

	// List private endpoint rules.
	//
	// Gets an array of private endpoint rules.
	ListPrivateEndpointRulesByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) (*ListNccAzurePrivateEndpointRulesResponse, error)
}

type NetworkConnectivityService added in v0.25.0

type NetworkConnectivityService interface {

	// Create a network connectivity configuration.
	CreateNetworkConnectivityConfiguration(ctx context.Context, request CreateNetworkConnectivityConfigRequest) (*NetworkConnectivityConfiguration, error)

	// Create a private endpoint rule.
	//
	// Create a private endpoint rule for the specified network connectivity
	// config object. Once the object is created, Databricks asynchronously
	// provisions a new Azure private endpoint to your specified Azure resource.
	//
	// **IMPORTANT**: You must use Azure portal or other Azure tools to approve
	// the private endpoint to complete the connection. To get the information
	// of the private endpoint created, make a `GET` request on the new private
	// endpoint rule. See [serverless private link].
	//
	// [serverless private link]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security/serverless-private-link
	CreatePrivateEndpointRule(ctx context.Context, request CreatePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)

	// Delete a network connectivity configuration.
	//
	// Deletes a network connectivity configuration.
	DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error

	// Delete a private endpoint rule.
	//
	// Initiates deleting a private endpoint rule. If the connection state is
	// PENDING or EXPIRED, the private endpoint is immediately deleted.
	// Otherwise, the private endpoint is deactivated and will be deleted after
	// seven days of deactivation. When a private endpoint is deactivated, the
	// `deactivated` field is set to `true` and the private endpoint is not
	// available to your serverless compute resources.
	DeletePrivateEndpointRule(ctx context.Context, request DeletePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)

	// Get a network connectivity configuration.
	//
	// Gets a network connectivity configuration.
	GetNetworkConnectivityConfiguration(ctx context.Context, request GetNetworkConnectivityConfigurationRequest) (*NetworkConnectivityConfiguration, error)

	// Get a private endpoint rule.
	//
	// Gets the private endpoint rule.
	GetPrivateEndpointRule(ctx context.Context, request GetPrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)

	// List network connectivity configurations.
	//
	// Gets an array of network connectivity configurations.
	//
	// Use ListNetworkConnectivityConfigurationsAll() to get all NetworkConnectivityConfiguration instances, which will iterate over every result page.
	ListNetworkConnectivityConfigurations(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) (*ListNetworkConnectivityConfigurationsResponse, error)

	// List private endpoint rules.
	//
	// Gets an array of private endpoint rules.
	//
	// Use ListPrivateEndpointRulesAll() to get all NccAzurePrivateEndpointRule instances, which will iterate over every result page.
	ListPrivateEndpointRules(ctx context.Context, request ListPrivateEndpointRulesRequest) (*ListNccAzurePrivateEndpointRulesResponse, error)
}

These APIs provide configurations for the network connectivity of your workspaces for serverless compute resources.

type PartitionId added in v0.21.0

type PartitionId struct {
	// The ID of the workspace.
	WorkspaceId int64 `json:"workspaceId,omitempty"`

	ForceSendFields []string `json:"-"`
}

Partition by workspace or account

func (PartitionId) MarshalJSON added in v0.23.0

func (s PartitionId) MarshalJSON() ([]byte, error)

func (*PartitionId) UnmarshalJSON added in v0.23.0

func (s *PartitionId) UnmarshalJSON(b []byte) error

type PersonalComputeAPI added in v0.34.0

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

The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources. By default all users in all workspaces have access (ON), but you can change the setting to instead let individual workspaces configure access control (DELEGATE).

There is only one instance of this setting per account. Since this setting has a default value, this setting is present on all accounts even though it's never set on a given account. Deletion reverts the value of the setting back to the default value.

func NewPersonalCompute added in v0.34.0

func NewPersonalCompute(client *client.DatabricksClient) *PersonalComputeAPI

func (*PersonalComputeAPI) Delete added in v0.34.0

Delete Personal Compute setting.

Reverts back the Personal Compute setting value to default (ON)

func (*PersonalComputeAPI) Get added in v0.34.0

Get Personal Compute setting.

Gets the value of the Personal Compute setting.

func (*PersonalComputeAPI) Impl added in v0.34.0

Impl returns low-level PersonalCompute API implementation Deprecated: use MockPersonalComputeInterface instead.

func (*PersonalComputeAPI) Update added in v0.34.0

Update Personal Compute setting.

Updates the value of the Personal Compute setting.

func (*PersonalComputeAPI) WithImpl added in v0.34.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockPersonalComputeInterface instead.

type PersonalComputeInterface added in v0.34.0

type PersonalComputeInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockPersonalComputeInterface instead.
	WithImpl(impl PersonalComputeService) PersonalComputeInterface

	// Impl returns low-level PersonalCompute API implementation
	// Deprecated: use MockPersonalComputeInterface instead.
	Impl() PersonalComputeService

	// Delete Personal Compute setting.
	//
	// Reverts back the Personal Compute setting value to default (ON)
	Delete(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error)

	// Get Personal Compute setting.
	//
	// Gets the value of the Personal Compute setting.
	Get(ctx context.Context, request GetPersonalComputeSettingRequest) (*PersonalComputeSetting, error)

	// Update Personal Compute setting.
	//
	// Updates the value of the Personal Compute setting.
	Update(ctx context.Context, request UpdatePersonalComputeSettingRequest) (*PersonalComputeSetting, error)
}

type PersonalComputeMessage added in v0.10.0

type PersonalComputeMessage struct {
	// ON: Grants all users in all workspaces access to the Personal Compute
	// default policy, allowing all users to create single-machine compute
	// resources. DELEGATE: Moves access control for the Personal Compute
	// default policy to individual workspaces and requires a workspace’s
	// users or groups to be added to the ACLs of that workspace’s Personal
	// Compute default policy before they will be able to create compute
	// resources through that policy.
	Value PersonalComputeMessageEnum `json:"value"`
}

type PersonalComputeMessageEnum added in v0.10.0

type PersonalComputeMessageEnum string

ON: Grants all users in all workspaces access to the Personal Compute default policy, allowing all users to create single-machine compute resources. DELEGATE: Moves access control for the Personal Compute default policy to individual workspaces and requires a workspace’s users or groups to be added to the ACLs of that workspace’s Personal Compute default policy before they will be able to create compute resources through that policy.

const PersonalComputeMessageEnumDelegate PersonalComputeMessageEnum = `DELEGATE`
const PersonalComputeMessageEnumOn PersonalComputeMessageEnum = `ON`

func (*PersonalComputeMessageEnum) Set added in v0.10.0

Set raw string value and validate it against allowed values

func (*PersonalComputeMessageEnum) String added in v0.10.0

func (f *PersonalComputeMessageEnum) String() string

String representation for fmt.Print

func (*PersonalComputeMessageEnum) Type added in v0.10.0

Type always returns PersonalComputeMessageEnum to satisfy [pflag.Value] interface

type PersonalComputeService added in v0.34.0

type PersonalComputeService interface {

	// Delete Personal Compute setting.
	//
	// Reverts back the Personal Compute setting value to default (ON)
	Delete(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error)

	// Get Personal Compute setting.
	//
	// Gets the value of the Personal Compute setting.
	Get(ctx context.Context, request GetPersonalComputeSettingRequest) (*PersonalComputeSetting, error)

	// Update Personal Compute setting.
	//
	// Updates the value of the Personal Compute setting.
	Update(ctx context.Context, request UpdatePersonalComputeSettingRequest) (*PersonalComputeSetting, error)
}

The Personal Compute enablement setting lets you control which users can use the Personal Compute default policy to create compute resources. By default all users in all workspaces have access (ON), but you can change the setting to instead let individual workspaces configure access control (DELEGATE).

There is only one instance of this setting per account. Since this setting has a default value, this setting is present on all accounts even though it's never set on a given account. Deletion reverts the value of the setting back to the default value.

type PersonalComputeSetting added in v0.11.0

type PersonalComputeSetting struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`

	PersonalCompute PersonalComputeMessage `json:"personal_compute"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (PersonalComputeSetting) MarshalJSON added in v0.23.0

func (s PersonalComputeSetting) MarshalJSON() ([]byte, error)

func (*PersonalComputeSetting) UnmarshalJSON added in v0.23.0

func (s *PersonalComputeSetting) UnmarshalJSON(b []byte) error

type PublicTokenInfo

type PublicTokenInfo struct {
	// Comment the token was created with, if applicable.
	Comment string `json:"comment,omitempty"`
	// Server time (in epoch milliseconds) when the token was created.
	CreationTime int64 `json:"creation_time,omitempty"`
	// Server time (in epoch milliseconds) when the token will expire, or -1 if
	// not applicable.
	ExpiryTime int64 `json:"expiry_time,omitempty"`
	// The ID of this token.
	TokenId string `json:"token_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (PublicTokenInfo) MarshalJSON added in v0.23.0

func (s PublicTokenInfo) MarshalJSON() ([]byte, error)

func (*PublicTokenInfo) UnmarshalJSON added in v0.23.0

func (s *PublicTokenInfo) UnmarshalJSON(b []byte) error

type ReplaceIpAccessList

type ReplaceIpAccessList struct {
	// Specifies whether this IP access list is enabled.
	Enabled bool `json:"enabled"`
	// The ID for the corresponding IP access list
	IpAccessListId string `json:"-" url:"-"`

	IpAddresses []string `json:"ip_addresses,omitempty"`
	// Label for the IP access list. This **cannot** be empty.
	Label string `json:"label"`
	// Type of IP access list. Valid values are as follows and are
	// case-sensitive:
	//
	// * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block
	// list. Exclude this IP or range. IP addresses in the block list are
	// excluded even if they are included in an allow list.
	ListType ListType `json:"list_type"`
}

Details required to replace an IP access list.

type ReplaceResponse added in v0.34.0

type ReplaceResponse struct {
}

type RestrictWorkspaceAdminsAPI added in v0.34.0

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

The Restrict Workspace Admins setting lets you control the capabilities of workspace admins. With the setting status set to ALLOW_ALL, workspace admins can create service principal personal access tokens on behalf of any service principal in their workspace. Workspace admins can also change a job owner to any user in their workspace. And they can change the job run_as setting to any user in their workspace or to a service principal on which they have the Service Principal User role. With the setting status set to RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins can only create personal access tokens on behalf of service principals they have the Service Principal User role on. They can also only change a job owner to themselves. And they can change the job run_as setting to themselves or to a service principal on which they have the Service Principal User role.

func NewRestrictWorkspaceAdmins added in v0.34.0

func NewRestrictWorkspaceAdmins(client *client.DatabricksClient) *RestrictWorkspaceAdminsAPI

func (*RestrictWorkspaceAdminsAPI) Delete added in v0.34.0

Delete the restrict workspace admins setting.

Reverts the restrict workspace admins setting status for the workspace. A fresh etag needs to be provided in `DELETE` requests (as a query parameter). The etag can be retrieved by making a `GET` request before the DELETE request. If the setting is updated/deleted concurrently, `DELETE` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*RestrictWorkspaceAdminsAPI) Get added in v0.34.0

Get the restrict workspace admins setting.

Gets the restrict workspace admins setting.

func (*RestrictWorkspaceAdminsAPI) Impl added in v0.34.0

Impl returns low-level RestrictWorkspaceAdmins API implementation Deprecated: use MockRestrictWorkspaceAdminsInterface instead.

func (*RestrictWorkspaceAdminsAPI) Update added in v0.34.0

Update the restrict workspace admins setting.

Updates the restrict workspace admins setting for the workspace. A fresh etag needs to be provided in `PATCH` requests (as part of the setting field). The etag can be retrieved by making a GET request before the `PATCH` request. If the setting is updated concurrently, `PATCH` fails with 409 and the request must be retried by using the fresh etag in the 409 response.

func (*RestrictWorkspaceAdminsAPI) WithImpl added in v0.34.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockRestrictWorkspaceAdminsInterface instead.

type RestrictWorkspaceAdminsInterface added in v0.34.0

type RestrictWorkspaceAdminsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockRestrictWorkspaceAdminsInterface instead.
	WithImpl(impl RestrictWorkspaceAdminsService) RestrictWorkspaceAdminsInterface

	// Impl returns low-level RestrictWorkspaceAdmins API implementation
	// Deprecated: use MockRestrictWorkspaceAdminsInterface instead.
	Impl() RestrictWorkspaceAdminsService

	// Delete the restrict workspace admins setting.
	//
	// Reverts the restrict workspace admins setting status for the workspace. A
	// fresh etag needs to be provided in `DELETE` requests (as a query parameter).
	// The etag can be retrieved by making a `GET` request before the DELETE
	// request. If the setting is updated/deleted concurrently, `DELETE` fails with
	// 409 and the request must be retried by using the fresh etag in the 409
	// response.
	Delete(ctx context.Context, request DeleteRestrictWorkspaceAdminsSettingRequest) (*DeleteRestrictWorkspaceAdminsSettingResponse, error)

	// Get the restrict workspace admins setting.
	//
	// Gets the restrict workspace admins setting.
	Get(ctx context.Context, request GetRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error)

	// Update the restrict workspace admins setting.
	//
	// Updates the restrict workspace admins setting for the workspace. A fresh etag
	// needs to be provided in `PATCH` requests (as part of the setting field). The
	// etag can be retrieved by making a GET request before the `PATCH` request. If
	// the setting is updated concurrently, `PATCH` fails with 409 and the request
	// must be retried by using the fresh etag in the 409 response.
	Update(ctx context.Context, request UpdateRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error)
}

type RestrictWorkspaceAdminsMessage added in v0.31.0

type RestrictWorkspaceAdminsMessage struct {
	Status RestrictWorkspaceAdminsMessageStatus `json:"status"`
}

type RestrictWorkspaceAdminsMessageStatus added in v0.31.0

type RestrictWorkspaceAdminsMessageStatus string
const RestrictWorkspaceAdminsMessageStatusAllowAll RestrictWorkspaceAdminsMessageStatus = `ALLOW_ALL`
const RestrictWorkspaceAdminsMessageStatusRestrictTokensAndJobRunAs RestrictWorkspaceAdminsMessageStatus = `RESTRICT_TOKENS_AND_JOB_RUN_AS`
const RestrictWorkspaceAdminsMessageStatusStatusUnspecified RestrictWorkspaceAdminsMessageStatus = `STATUS_UNSPECIFIED`

func (*RestrictWorkspaceAdminsMessageStatus) Set added in v0.31.0

Set raw string value and validate it against allowed values

func (*RestrictWorkspaceAdminsMessageStatus) String added in v0.31.0

String representation for fmt.Print

func (*RestrictWorkspaceAdminsMessageStatus) Type added in v0.31.0

Type always returns RestrictWorkspaceAdminsMessageStatus to satisfy [pflag.Value] interface

type RestrictWorkspaceAdminsService added in v0.34.0

type RestrictWorkspaceAdminsService interface {

	// Delete the restrict workspace admins setting.
	//
	// Reverts the restrict workspace admins setting status for the workspace. A
	// fresh etag needs to be provided in `DELETE` requests (as a query
	// parameter). The etag can be retrieved by making a `GET` request before
	// the DELETE request. If the setting is updated/deleted concurrently,
	// `DELETE` fails with 409 and the request must be retried by using the
	// fresh etag in the 409 response.
	Delete(ctx context.Context, request DeleteRestrictWorkspaceAdminsSettingRequest) (*DeleteRestrictWorkspaceAdminsSettingResponse, error)

	// Get the restrict workspace admins setting.
	//
	// Gets the restrict workspace admins setting.
	Get(ctx context.Context, request GetRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error)

	// Update the restrict workspace admins setting.
	//
	// Updates the restrict workspace admins setting for the workspace. A fresh
	// etag needs to be provided in `PATCH` requests (as part of the setting
	// field). The etag can be retrieved by making a GET request before the
	// `PATCH` request. If the setting is updated concurrently, `PATCH` fails
	// with 409 and the request must be retried by using the fresh etag in the
	// 409 response.
	Update(ctx context.Context, request UpdateRestrictWorkspaceAdminsSettingRequest) (*RestrictWorkspaceAdminsSetting, error)
}

The Restrict Workspace Admins setting lets you control the capabilities of workspace admins. With the setting status set to ALLOW_ALL, workspace admins can create service principal personal access tokens on behalf of any service principal in their workspace. Workspace admins can also change a job owner to any user in their workspace. And they can change the job run_as setting to any user in their workspace or to a service principal on which they have the Service Principal User role. With the setting status set to RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins can only create personal access tokens on behalf of service principals they have the Service Principal User role on. They can also only change a job owner to themselves. And they can change the job run_as setting to themselves or to a service principal on which they have the Service Principal User role.

type RestrictWorkspaceAdminsSetting added in v0.31.0

type RestrictWorkspaceAdminsSetting struct {
	// etag used for versioning. The response is at least as fresh as the eTag
	// provided. This is used for optimistic concurrency control as a way to
	// help prevent simultaneous writes of a setting overwriting each other. It
	// is strongly suggested that systems make use of the etag in the read ->
	// update pattern to perform setting updates in order to avoid race
	// conditions. That is, get an etag from a GET request, and pass it with the
	// PATCH request to identify the setting version you are updating.
	Etag string `json:"etag,omitempty"`

	RestrictWorkspaceAdmins RestrictWorkspaceAdminsMessage `json:"restrict_workspace_admins"`
	// Name of the corresponding setting. This field is populated in the
	// response, but it will not be respected even if it's set in the request
	// body. The setting name in the path parameter will be respected instead.
	// Setting name is required to be 'default' if the setting only has one
	// instance per workspace.
	SettingName string `json:"setting_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RestrictWorkspaceAdminsSetting) MarshalJSON added in v0.31.0

func (s RestrictWorkspaceAdminsSetting) MarshalJSON() ([]byte, error)

func (*RestrictWorkspaceAdminsSetting) UnmarshalJSON added in v0.31.0

func (s *RestrictWorkspaceAdminsSetting) UnmarshalJSON(b []byte) error

type RevokeTokenRequest

type RevokeTokenRequest struct {
	// The ID of the token to be revoked.
	TokenId string `json:"token_id"`
}

type RevokeTokenResponse added in v0.34.0

type RevokeTokenResponse struct {
}

type SetStatusResponse added in v0.34.0

type SetStatusResponse struct {
}

type SettingsAPI added in v0.21.0

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

Workspace Settings API allows users to manage settings at the workspace level.

func NewSettings added in v0.21.0

func NewSettings(client *client.DatabricksClient) *SettingsAPI

func (*SettingsAPI) AutomaticClusterUpdate added in v0.34.0

func (a *SettingsAPI) AutomaticClusterUpdate() AutomaticClusterUpdateInterface

func (*SettingsAPI) ComplianceSecurityProfile added in v0.40.0

func (a *SettingsAPI) ComplianceSecurityProfile() ComplianceSecurityProfileInterface

func (*SettingsAPI) DefaultNamespace added in v0.34.0

func (a *SettingsAPI) DefaultNamespace() DefaultNamespaceInterface

func (*SettingsAPI) EnhancedSecurityMonitoring added in v0.40.0

func (a *SettingsAPI) EnhancedSecurityMonitoring() EnhancedSecurityMonitoringInterface

func (*SettingsAPI) Impl added in v0.21.0

func (a *SettingsAPI) Impl() SettingsService

Impl returns low-level Settings API implementation Deprecated: use MockSettingsInterface instead.

func (*SettingsAPI) RestrictWorkspaceAdmins added in v0.34.0

func (a *SettingsAPI) RestrictWorkspaceAdmins() RestrictWorkspaceAdminsInterface

func (*SettingsAPI) WithImpl added in v0.21.0

func (a *SettingsAPI) WithImpl(impl SettingsService) SettingsInterface

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockSettingsInterface instead.

type SettingsInterface added in v0.29.0

type SettingsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockSettingsInterface instead.
	WithImpl(impl SettingsService) SettingsInterface

	// Impl returns low-level Settings API implementation
	// Deprecated: use MockSettingsInterface instead.
	Impl() SettingsService

	// Controls whether automatic cluster update is enabled for the current
	// workspace. By default, it is turned off.
	AutomaticClusterUpdate() AutomaticClusterUpdateInterface

	// Controls whether to enable the compliance security profile for the
	// current workspace. Enabling it on a workspace is permanent. By default,
	// it is turned off.
	//
	// This settings can NOT be disabled once it is enabled.
	ComplianceSecurityProfile() ComplianceSecurityProfileInterface

	// The default namespace setting API allows users to configure the default
	// namespace for a Databricks workspace.
	//
	// Through this API, users can retrieve, set, or modify the default
	// namespace used when queries do not reference a fully qualified
	// three-level name. For example, if you use the API to set 'retail_prod' as
	// the default catalog, then a query 'SELECT * FROM myTable' would reference
	// the object 'retail_prod.default.myTable' (the schema 'default' is always
	// assumed).
	//
	// This setting requires a restart of clusters and SQL warehouses to take
	// effect. Additionally, the default namespace only applies when using Unity
	// Catalog-enabled compute.
	DefaultNamespace() DefaultNamespaceInterface

	// Controls whether enhanced security monitoring is enabled for the current
	// workspace. If the compliance security profile is enabled, this is
	// automatically enabled. By default, it is disabled. However, if the
	// compliance security profile is enabled, this is automatically enabled.
	//
	// If the compliance security profile is disabled, you can enable or disable
	// this setting and it is not permanent.
	EnhancedSecurityMonitoring() EnhancedSecurityMonitoringInterface

	// The Restrict Workspace Admins setting lets you control the capabilities
	// of workspace admins. With the setting status set to ALLOW_ALL, workspace
	// admins can create service principal personal access tokens on behalf of
	// any service principal in their workspace. Workspace admins can also
	// change a job owner to any user in their workspace. And they can change
	// the job run_as setting to any user in their workspace or to a service
	// principal on which they have the Service Principal User role. With the
	// setting status set to RESTRICT_TOKENS_AND_JOB_RUN_AS, workspace admins
	// can only create personal access tokens on behalf of service principals
	// they have the Service Principal User role on. They can also only change a
	// job owner to themselves. And they can change the job run_as setting to
	// themselves or to a service principal on which they have the Service
	// Principal User role.
	RestrictWorkspaceAdmins() RestrictWorkspaceAdminsInterface
}

type SettingsService added in v0.21.0

type SettingsService interface {
}

Workspace Settings API allows users to manage settings at the workspace level.

type StringMessage added in v0.21.0

type StringMessage struct {
	// Represents a generic string value.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (StringMessage) MarshalJSON added in v0.23.0

func (s StringMessage) MarshalJSON() ([]byte, error)

func (*StringMessage) UnmarshalJSON added in v0.23.0

func (s *StringMessage) UnmarshalJSON(b []byte) error

type TokenAccessControlRequest added in v0.15.0

type TokenAccessControlRequest struct {
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Permission level
	PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"`
	// application ID of a service principal
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (TokenAccessControlRequest) MarshalJSON added in v0.23.0

func (s TokenAccessControlRequest) MarshalJSON() ([]byte, error)

func (*TokenAccessControlRequest) UnmarshalJSON added in v0.23.0

func (s *TokenAccessControlRequest) UnmarshalJSON(b []byte) error

type TokenAccessControlResponse added in v0.15.0

type TokenAccessControlResponse struct {
	// All permissions.
	AllPermissions []TokenPermission `json:"all_permissions,omitempty"`
	// Display name of the user or service principal.
	DisplayName string `json:"display_name,omitempty"`
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Name of the service principal.
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (TokenAccessControlResponse) MarshalJSON added in v0.23.0

func (s TokenAccessControlResponse) MarshalJSON() ([]byte, error)

func (*TokenAccessControlResponse) UnmarshalJSON added in v0.23.0

func (s *TokenAccessControlResponse) UnmarshalJSON(b []byte) error

type TokenInfo

type TokenInfo struct {
	// Comment that describes the purpose of the token, specified by the token
	// creator.
	Comment string `json:"comment,omitempty"`
	// User ID of the user that created the token.
	CreatedById int64 `json:"created_by_id,omitempty"`
	// Username of the user that created the token.
	CreatedByUsername string `json:"created_by_username,omitempty"`
	// Timestamp when the token was created.
	CreationTime int64 `json:"creation_time,omitempty"`
	// Timestamp when the token expires.
	ExpiryTime int64 `json:"expiry_time,omitempty"`
	// User ID of the user that owns the token.
	OwnerId int64 `json:"owner_id,omitempty"`
	// ID of the token.
	TokenId string `json:"token_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (TokenInfo) MarshalJSON added in v0.23.0

func (s TokenInfo) MarshalJSON() ([]byte, error)

func (*TokenInfo) UnmarshalJSON added in v0.23.0

func (s *TokenInfo) UnmarshalJSON(b []byte) error

type TokenManagementAPI

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

Enables administrators to get all tokens and delete tokens for other users. Admins can either get every token, get a specific token by ID, or get all tokens for a particular user.

func NewTokenManagement

func NewTokenManagement(client *client.DatabricksClient) *TokenManagementAPI

func (*TokenManagementAPI) CreateOboToken

Create on-behalf token.

Creates a token on behalf of a service principal.

Example (CreateOboTokenOnAws)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

groups, err := w.Groups.GroupDisplayNameToIdMap(ctx, iam.ListGroupsRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", groups)

spn, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
	DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Groups: []iam.ComplexValue{iam.ComplexValue{
		Value: groups["admins"],
	}},
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", spn)

obo, err := w.TokenManagement.CreateOboToken(ctx, settings.CreateOboTokenRequest{
	ApplicationId:   spn.ApplicationId,
	LifetimeSeconds: 60,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", obo)

// cleanup

err = w.ServicePrincipals.DeleteById(ctx, spn.Id)
if err != nil {
	panic(err)
}
err = w.TokenManagement.DeleteByTokenId(ctx, obo.TokenInfo.TokenId)
if err != nil {
	panic(err)
}
Output:

func (*TokenManagementAPI) Delete

Delete a token.

Deletes a token, specified by its ID.

func (*TokenManagementAPI) DeleteByTokenId

func (a *TokenManagementAPI) DeleteByTokenId(ctx context.Context, tokenId string) error

Delete a token.

Deletes a token, specified by its ID.

func (*TokenManagementAPI) Get

Get token info.

Gets information about a token, specified by its ID.

Example (CreateOboTokenOnAws)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

groups, err := w.Groups.GroupDisplayNameToIdMap(ctx, iam.ListGroupsRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", groups)

spn, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
	DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Groups: []iam.ComplexValue{iam.ComplexValue{
		Value: groups["admins"],
	}},
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", spn)

obo, err := w.TokenManagement.CreateOboToken(ctx, settings.CreateOboTokenRequest{
	ApplicationId:   spn.ApplicationId,
	LifetimeSeconds: 60,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", obo)

byId, err := w.TokenManagement.GetByTokenId(ctx, obo.TokenInfo.TokenId)
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", byId)

// cleanup

err = w.ServicePrincipals.DeleteById(ctx, spn.Id)
if err != nil {
	panic(err)
}
err = w.TokenManagement.DeleteByTokenId(ctx, obo.TokenInfo.TokenId)
if err != nil {
	panic(err)
}
Output:

func (*TokenManagementAPI) GetByComment

func (a *TokenManagementAPI) GetByComment(ctx context.Context, name string) (*TokenInfo, error)

GetByComment calls TokenManagementAPI.TokenInfoCommentToTokenIdMap and returns a single TokenInfo.

Returns an error if there's more than one TokenInfo with the same .Comment.

Note: All TokenInfo instances are loaded into memory before returning matching by name.

This method is generated by Databricks SDK Code Generator.

func (*TokenManagementAPI) GetByTokenId

func (a *TokenManagementAPI) GetByTokenId(ctx context.Context, tokenId string) (*GetTokenResponse, error)

Get token info.

Gets information about a token, specified by its ID.

func (*TokenManagementAPI) GetPermissionLevels added in v0.19.0

Get token permission levels.

Gets the permission levels that a user can have on an object.

func (*TokenManagementAPI) GetPermissions added in v0.19.0

func (a *TokenManagementAPI) GetPermissions(ctx context.Context) (*TokenPermissions, error)

Get token permissions.

Gets the permissions of all tokens. Tokens can inherit permissions from their root object.

func (*TokenManagementAPI) Impl

Impl returns low-level TokenManagement API implementation Deprecated: use MockTokenManagementInterface instead.

func (*TokenManagementAPI) List added in v0.24.0

List all tokens.

Lists all tokens associated with the specified workspace or user.

This method is generated by Databricks SDK Code Generator.

func (*TokenManagementAPI) ListAll

List all tokens.

Lists all tokens associated with the specified workspace or user.

This method is generated by Databricks SDK Code Generator.

Example (CreateOboTokenOnAws)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.TokenManagement.ListAll(ctx, settings.ListTokenManagementRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*TokenManagementAPI) SetPermissions added in v0.19.0

Set token permissions.

Sets permissions on all tokens. Tokens can inherit permissions from their root object.

func (*TokenManagementAPI) TokenInfoCommentToTokenIdMap added in v0.9.0

func (a *TokenManagementAPI) TokenInfoCommentToTokenIdMap(ctx context.Context, request ListTokenManagementRequest) (map[string]string, error)

TokenInfoCommentToTokenIdMap calls TokenManagementAPI.ListAll and creates a map of results with TokenInfo.Comment as key and TokenInfo.TokenId as value.

Returns an error if there's more than one TokenInfo with the same .Comment.

Note: All TokenInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*TokenManagementAPI) UpdatePermissions added in v0.19.0

func (a *TokenManagementAPI) UpdatePermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)

Update token permissions.

Updates the permissions on all tokens. Tokens can inherit permissions from their root object.

func (*TokenManagementAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockTokenManagementInterface instead.

type TokenManagementInterface added in v0.29.0

type TokenManagementInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockTokenManagementInterface instead.
	WithImpl(impl TokenManagementService) TokenManagementInterface

	// Impl returns low-level TokenManagement API implementation
	// Deprecated: use MockTokenManagementInterface instead.
	Impl() TokenManagementService

	// Create on-behalf token.
	//
	// Creates a token on behalf of a service principal.
	CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error)

	// Delete a token.
	//
	// Deletes a token, specified by its ID.
	Delete(ctx context.Context, request DeleteTokenManagementRequest) error

	// Delete a token.
	//
	// Deletes a token, specified by its ID.
	DeleteByTokenId(ctx context.Context, tokenId string) error

	// Get token info.
	//
	// Gets information about a token, specified by its ID.
	Get(ctx context.Context, request GetTokenManagementRequest) (*GetTokenResponse, error)

	// Get token info.
	//
	// Gets information about a token, specified by its ID.
	GetByTokenId(ctx context.Context, tokenId string) (*GetTokenResponse, error)

	// Get token permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context) (*GetTokenPermissionLevelsResponse, error)

	// Get token permissions.
	//
	// Gets the permissions of all tokens. Tokens can inherit permissions from their
	// root object.
	GetPermissions(ctx context.Context) (*TokenPermissions, error)

	// List all tokens.
	//
	// Lists all tokens associated with the specified workspace or user.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context, request ListTokenManagementRequest) listing.Iterator[TokenInfo]

	// List all tokens.
	//
	// Lists all tokens associated with the specified workspace or user.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context, request ListTokenManagementRequest) ([]TokenInfo, error)

	// TokenInfoCommentToTokenIdMap calls [TokenManagementAPI.ListAll] and creates a map of results with [TokenInfo].Comment as key and [TokenInfo].TokenId as value.
	//
	// Returns an error if there's more than one [TokenInfo] with the same .Comment.
	//
	// Note: All [TokenInfo] instances are loaded into memory before creating a map.
	//
	// This method is generated by Databricks SDK Code Generator.
	TokenInfoCommentToTokenIdMap(ctx context.Context, request ListTokenManagementRequest) (map[string]string, error)

	// GetByComment calls [TokenManagementAPI.TokenInfoCommentToTokenIdMap] and returns a single [TokenInfo].
	//
	// Returns an error if there's more than one [TokenInfo] with the same .Comment.
	//
	// Note: All [TokenInfo] instances are loaded into memory before returning matching by name.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetByComment(ctx context.Context, name string) (*TokenInfo, error)

	// Set token permissions.
	//
	// Sets permissions on all tokens. Tokens can inherit permissions from their
	// root object.
	SetPermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)

	// Update token permissions.
	//
	// Updates the permissions on all tokens. Tokens can inherit permissions from
	// their root object.
	UpdatePermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)
}

type TokenManagementService

type TokenManagementService interface {

	// Create on-behalf token.
	//
	// Creates a token on behalf of a service principal.
	CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error)

	// Delete a token.
	//
	// Deletes a token, specified by its ID.
	Delete(ctx context.Context, request DeleteTokenManagementRequest) error

	// Get token info.
	//
	// Gets information about a token, specified by its ID.
	Get(ctx context.Context, request GetTokenManagementRequest) (*GetTokenResponse, error)

	// Get token permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context) (*GetTokenPermissionLevelsResponse, error)

	// Get token permissions.
	//
	// Gets the permissions of all tokens. Tokens can inherit permissions from
	// their root object.
	GetPermissions(ctx context.Context) (*TokenPermissions, error)

	// List all tokens.
	//
	// Lists all tokens associated with the specified workspace or user.
	//
	// Use ListAll() to get all TokenInfo instances
	List(ctx context.Context, request ListTokenManagementRequest) (*ListTokensResponse, error)

	// Set token permissions.
	//
	// Sets permissions on all tokens. Tokens can inherit permissions from their
	// root object.
	SetPermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)

	// Update token permissions.
	//
	// Updates the permissions on all tokens. Tokens can inherit permissions
	// from their root object.
	UpdatePermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)
}

Enables administrators to get all tokens and delete tokens for other users. Admins can either get every token, get a specific token by ID, or get all tokens for a particular user.

type TokenPermission added in v0.15.0

type TokenPermission struct {
	Inherited bool `json:"inherited,omitempty"`

	InheritedFromObject []string `json:"inherited_from_object,omitempty"`
	// Permission level
	PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (TokenPermission) MarshalJSON added in v0.23.0

func (s TokenPermission) MarshalJSON() ([]byte, error)

func (*TokenPermission) UnmarshalJSON added in v0.23.0

func (s *TokenPermission) UnmarshalJSON(b []byte) error

type TokenPermissionLevel added in v0.15.0

type TokenPermissionLevel string

Permission level

const TokenPermissionLevelCanUse TokenPermissionLevel = `CAN_USE`

func (*TokenPermissionLevel) Set added in v0.15.0

func (f *TokenPermissionLevel) Set(v string) error

Set raw string value and validate it against allowed values

func (*TokenPermissionLevel) String added in v0.15.0

func (f *TokenPermissionLevel) String() string

String representation for fmt.Print

func (*TokenPermissionLevel) Type added in v0.15.0

func (f *TokenPermissionLevel) Type() string

Type always returns TokenPermissionLevel to satisfy [pflag.Value] interface

type TokenPermissions added in v0.15.0

type TokenPermissions struct {
	AccessControlList []TokenAccessControlResponse `json:"access_control_list,omitempty"`

	ObjectId string `json:"object_id,omitempty"`

	ObjectType string `json:"object_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (TokenPermissions) MarshalJSON added in v0.23.0

func (s TokenPermissions) MarshalJSON() ([]byte, error)

func (*TokenPermissions) UnmarshalJSON added in v0.23.0

func (s *TokenPermissions) UnmarshalJSON(b []byte) error

type TokenPermissionsDescription added in v0.15.0

type TokenPermissionsDescription struct {
	Description string `json:"description,omitempty"`
	// Permission level
	PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (TokenPermissionsDescription) MarshalJSON added in v0.23.0

func (s TokenPermissionsDescription) MarshalJSON() ([]byte, error)

func (*TokenPermissionsDescription) UnmarshalJSON added in v0.23.0

func (s *TokenPermissionsDescription) UnmarshalJSON(b []byte) error

type TokenPermissionsRequest added in v0.15.0

type TokenPermissionsRequest struct {
	AccessControlList []TokenAccessControlRequest `json:"access_control_list,omitempty"`
}

type TokenType added in v0.20.0

type TokenType string

The type of token request. As of now, only `AZURE_ACTIVE_DIRECTORY_TOKEN` is supported.

const TokenTypeAzureActiveDirectoryToken TokenType = `AZURE_ACTIVE_DIRECTORY_TOKEN`

func (*TokenType) Set added in v0.20.0

func (f *TokenType) Set(v string) error

Set raw string value and validate it against allowed values

func (*TokenType) String added in v0.20.0

func (f *TokenType) String() string

String representation for fmt.Print

func (*TokenType) Type added in v0.20.0

func (f *TokenType) Type() string

Type always returns TokenType to satisfy [pflag.Value] interface

type TokensAPI

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

The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.

func NewTokens

func NewTokens(client *client.DatabricksClient) *TokensAPI

func (*TokensAPI) Create

Create a user token.

Creates and returns a token for a user. If this call is made through token authentication, it creates a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call returns an error **QUOTA_EXCEEDED**.

Example (Tokens)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

token, err := w.Tokens.Create(ctx, settings.CreateTokenRequest{
	Comment:         fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	LifetimeSeconds: 300,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", token)

// cleanup

err = w.Tokens.DeleteByTokenId(ctx, token.TokenInfo.TokenId)
if err != nil {
	panic(err)
}
Output:

func (*TokensAPI) Delete

func (a *TokensAPI) Delete(ctx context.Context, request RevokeTokenRequest) error

Revoke token.

Revokes an access token.

If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.

func (*TokensAPI) DeleteByTokenId

func (a *TokensAPI) DeleteByTokenId(ctx context.Context, tokenId string) error

Revoke token.

Revokes an access token.

If a token with the specified ID is not valid, this call returns an error **RESOURCE_DOES_NOT_EXIST**.

func (*TokensAPI) GetByComment

func (a *TokensAPI) GetByComment(ctx context.Context, name string) (*PublicTokenInfo, error)

GetByComment calls TokensAPI.PublicTokenInfoCommentToTokenIdMap and returns a single PublicTokenInfo.

Returns an error if there's more than one PublicTokenInfo with the same .Comment.

Note: All PublicTokenInfo instances are loaded into memory before returning matching by name.

This method is generated by Databricks SDK Code Generator.

func (*TokensAPI) Impl

func (a *TokensAPI) Impl() TokensService

Impl returns low-level Tokens API implementation Deprecated: use MockTokensInterface instead.

func (*TokensAPI) List added in v0.24.0

List tokens.

Lists all the valid tokens for a user-workspace pair.

This method is generated by Databricks SDK Code Generator.

func (*TokensAPI) ListAll

func (a *TokensAPI) ListAll(ctx context.Context) ([]PublicTokenInfo, error)

List tokens.

Lists all the valid tokens for a user-workspace pair.

This method is generated by Databricks SDK Code Generator.

Example (Tokens)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.Tokens.ListAll(ctx)
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*TokensAPI) PublicTokenInfoCommentToTokenIdMap

func (a *TokensAPI) PublicTokenInfoCommentToTokenIdMap(ctx context.Context) (map[string]string, error)

PublicTokenInfoCommentToTokenIdMap calls TokensAPI.ListAll and creates a map of results with PublicTokenInfo.Comment as key and PublicTokenInfo.TokenId as value.

Returns an error if there's more than one PublicTokenInfo with the same .Comment.

Note: All PublicTokenInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*TokensAPI) WithImpl

func (a *TokensAPI) WithImpl(impl TokensService) TokensInterface

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockTokensInterface instead.

type TokensInterface added in v0.29.0

type TokensInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockTokensInterface instead.
	WithImpl(impl TokensService) TokensInterface

	// Impl returns low-level Tokens API implementation
	// Deprecated: use MockTokensInterface instead.
	Impl() TokensService

	// Create a user token.
	//
	// Creates and returns a token for a user. If this call is made through token
	// authentication, it creates a token with the same client ID as the
	// authenticated token. If the user's token quota is exceeded, this call returns
	// an error **QUOTA_EXCEEDED**.
	Create(ctx context.Context, request CreateTokenRequest) (*CreateTokenResponse, error)

	// Revoke token.
	//
	// Revokes an access token.
	//
	// If a token with the specified ID is not valid, this call returns an error
	// **RESOURCE_DOES_NOT_EXIST**.
	Delete(ctx context.Context, request RevokeTokenRequest) error

	// Revoke token.
	//
	// Revokes an access token.
	//
	// If a token with the specified ID is not valid, this call returns an error
	// **RESOURCE_DOES_NOT_EXIST**.
	DeleteByTokenId(ctx context.Context, tokenId string) error

	// List tokens.
	//
	// Lists all the valid tokens for a user-workspace pair.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context) listing.Iterator[PublicTokenInfo]

	// List tokens.
	//
	// Lists all the valid tokens for a user-workspace pair.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context) ([]PublicTokenInfo, error)

	// PublicTokenInfoCommentToTokenIdMap calls [TokensAPI.ListAll] and creates a map of results with [PublicTokenInfo].Comment as key and [PublicTokenInfo].TokenId as value.
	//
	// Returns an error if there's more than one [PublicTokenInfo] with the same .Comment.
	//
	// Note: All [PublicTokenInfo] instances are loaded into memory before creating a map.
	//
	// This method is generated by Databricks SDK Code Generator.
	PublicTokenInfoCommentToTokenIdMap(ctx context.Context) (map[string]string, error)

	// GetByComment calls [TokensAPI.PublicTokenInfoCommentToTokenIdMap] and returns a single [PublicTokenInfo].
	//
	// Returns an error if there's more than one [PublicTokenInfo] with the same .Comment.
	//
	// Note: All [PublicTokenInfo] instances are loaded into memory before returning matching by name.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetByComment(ctx context.Context, name string) (*PublicTokenInfo, error)
}

type TokensService

type TokensService interface {

	// Create a user token.
	//
	// Creates and returns a token for a user. If this call is made through
	// token authentication, it creates a token with the same client ID as the
	// authenticated token. If the user's token quota is exceeded, this call
	// returns an error **QUOTA_EXCEEDED**.
	Create(ctx context.Context, request CreateTokenRequest) (*CreateTokenResponse, error)

	// Revoke token.
	//
	// Revokes an access token.
	//
	// If a token with the specified ID is not valid, this call returns an error
	// **RESOURCE_DOES_NOT_EXIST**.
	Delete(ctx context.Context, request RevokeTokenRequest) error

	// List tokens.
	//
	// Lists all the valid tokens for a user-workspace pair.
	//
	// Use ListAll() to get all PublicTokenInfo instances
	List(ctx context.Context) (*ListPublicTokensResponse, error)
}

The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.

type UpdateAutomaticClusterUpdateSettingRequest added in v0.34.0

type UpdateAutomaticClusterUpdateSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting AutomaticClusterUpdateSetting `json:"setting"`
}

Details required to update a setting.

type UpdateComplianceSecurityProfileSettingRequest added in v0.40.0

type UpdateComplianceSecurityProfileSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting ComplianceSecurityProfileSetting `json:"setting"`
}

Details required to update a setting.

type UpdateCspEnablementAccountSettingRequest added in v0.34.0

type UpdateCspEnablementAccountSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting CspEnablementAccountSetting `json:"setting"`
}

Details required to update a setting.

type UpdateDefaultNamespaceSettingRequest added in v0.31.0

type UpdateDefaultNamespaceSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`
	// This represents the setting configuration for the default namespace in
	// the Databricks workspace. Setting the default catalog for the workspace
	// determines the catalog that is used when queries do not reference a fully
	// qualified 3 level name. For example, if the default catalog is set to
	// 'retail_prod' then a query 'SELECT * FROM myTable' would reference the
	// object 'retail_prod.default.myTable' (the schema 'default' is always
	// assumed). This setting requires a restart of clusters and SQL warehouses
	// to take effect. Additionally, the default namespace only applies when
	// using Unity Catalog-enabled compute.
	Setting DefaultNamespaceSetting `json:"setting"`
}

Details required to update a setting.

type UpdateEnhancedSecurityMonitoringSettingRequest added in v0.40.0

type UpdateEnhancedSecurityMonitoringSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting EnhancedSecurityMonitoringSetting `json:"setting"`
}

Details required to update a setting.

type UpdateEsmEnablementAccountSettingRequest added in v0.34.0

type UpdateEsmEnablementAccountSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting EsmEnablementAccountSetting `json:"setting"`
}

Details required to update a setting.

type UpdateIpAccessList

type UpdateIpAccessList struct {
	// Specifies whether this IP access list is enabled.
	Enabled bool `json:"enabled,omitempty"`
	// The ID for the corresponding IP access list
	IpAccessListId string `json:"-" url:"-"`

	IpAddresses []string `json:"ip_addresses,omitempty"`
	// Label for the IP access list. This **cannot** be empty.
	Label string `json:"label,omitempty"`
	// Type of IP access list. Valid values are as follows and are
	// case-sensitive:
	//
	// * `ALLOW`: An allow list. Include this IP or range. * `BLOCK`: A block
	// list. Exclude this IP or range. IP addresses in the block list are
	// excluded even if they are included in an allow list.
	ListType ListType `json:"list_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

Details required to update an IP access list.

func (UpdateIpAccessList) MarshalJSON added in v0.23.0

func (s UpdateIpAccessList) MarshalJSON() ([]byte, error)

func (*UpdateIpAccessList) UnmarshalJSON added in v0.23.0

func (s *UpdateIpAccessList) UnmarshalJSON(b []byte) error

type UpdatePersonalComputeSettingRequest added in v0.11.0

type UpdatePersonalComputeSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting PersonalComputeSetting `json:"setting"`
}

Details required to update a setting.

type UpdateResponse added in v0.34.0

type UpdateResponse struct {
}

type UpdateRestrictWorkspaceAdminsSettingRequest added in v0.31.0

type UpdateRestrictWorkspaceAdminsSettingRequest struct {
	// This should always be set to true for Settings API. Added for AIP
	// compliance.
	AllowMissing bool `json:"allow_missing"`
	// Field mask is required to be passed into the PATCH request. Field mask
	// specifies which fields of the setting payload will be updated. The field
	// mask needs to be supplied as single string. To specify multiple fields in
	// the field mask, use comma as the separator (no space).
	FieldMask string `json:"field_mask"`

	Setting RestrictWorkspaceAdminsSetting `json:"setting"`
}

Details required to update a setting.

type WorkspaceConf

type WorkspaceConf map[string]string

type WorkspaceConfAPI

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

This API allows updating known workspace settings for advanced users.

func NewWorkspaceConf

func NewWorkspaceConf(client *client.DatabricksClient) *WorkspaceConfAPI

func (*WorkspaceConfAPI) GetStatus

func (a *WorkspaceConfAPI) GetStatus(ctx context.Context, request GetStatusRequest) (*map[string]string, error)

Check configuration status.

Gets the configuration status for a workspace.

Example (Repos)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

conf, err := w.WorkspaceConf.GetStatus(ctx, settings.GetStatusRequest{
	Keys: "enableWorkspaceFilesystem",
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", conf)
Output:

func (*WorkspaceConfAPI) Impl

Impl returns low-level WorkspaceConf API implementation Deprecated: use MockWorkspaceConfInterface instead.

func (*WorkspaceConfAPI) SetStatus

func (a *WorkspaceConfAPI) SetStatus(ctx context.Context, request WorkspaceConf) error

Enable/disable features.

Sets the configuration status for a workspace, including enabling or disabling it.

func (*WorkspaceConfAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockWorkspaceConfInterface instead.

type WorkspaceConfInterface added in v0.29.0

type WorkspaceConfInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockWorkspaceConfInterface instead.
	WithImpl(impl WorkspaceConfService) WorkspaceConfInterface

	// Impl returns low-level WorkspaceConf API implementation
	// Deprecated: use MockWorkspaceConfInterface instead.
	Impl() WorkspaceConfService

	// Check configuration status.
	//
	// Gets the configuration status for a workspace.
	GetStatus(ctx context.Context, request GetStatusRequest) (*map[string]string, error)

	// Enable/disable features.
	//
	// Sets the configuration status for a workspace, including enabling or
	// disabling it.
	SetStatus(ctx context.Context, request WorkspaceConf) error
}

type WorkspaceConfService

type WorkspaceConfService interface {

	// Check configuration status.
	//
	// Gets the configuration status for a workspace.
	GetStatus(ctx context.Context, request GetStatusRequest) (*map[string]string, error)

	// Enable/disable features.
	//
	// Sets the configuration status for a workspace, including enabling or
	// disabling it.
	SetStatus(ctx context.Context, request WorkspaceConf) error
}

This API allows updating known workspace settings for advanced users.

Jump to

Keyboard shortcuts

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