Documentation
¶
Overview ¶
These APIs allow you to manage Account Ip Access Lists, Account Network Policy, Account Settings, Credentials Manager, Ip Access Lists, Settings, Token Management, Tokens, Workspace Conf, etc.
Index ¶
- type AccountIpAccessListsAPI
- func (a *AccountIpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
- func (a *AccountIpAccessListsAPI) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error
- func (a *AccountIpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error
- func (a *AccountIpAccessListsAPI) Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error)
- func (a *AccountIpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*GetIpAccessListResponse, error)
- func (a *AccountIpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)
- func (a *AccountIpAccessListsAPI) Impl() AccountIpAccessListsService
- func (a *AccountIpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)
- func (a *AccountIpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
- func (a *AccountIpAccessListsAPI) Replace(ctx context.Context, request ReplaceIpAccessList) error
- func (a *AccountIpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error
- func (a *AccountIpAccessListsAPI) WithImpl(impl AccountIpAccessListsService) *AccountIpAccessListsAPI
- type AccountIpAccessListsService
- type AccountNetworkPolicyAPI
- func (a *AccountNetworkPolicyAPI) DeleteAccountNetworkPolicy(ctx context.Context, request DeleteAccountNetworkPolicyRequest) (*DeleteAccountNetworkPolicyResponse, error)
- func (a *AccountNetworkPolicyAPI) Impl() AccountNetworkPolicyService
- func (a *AccountNetworkPolicyAPI) ReadAccountNetworkPolicy(ctx context.Context, request ReadAccountNetworkPolicyRequest) (*AccountNetworkPolicyMessage, error)
- func (a *AccountNetworkPolicyAPI) UpdateAccountNetworkPolicy(ctx context.Context, request UpdateAccountNetworkPolicyRequest) (*AccountNetworkPolicyMessage, error)
- func (a *AccountNetworkPolicyAPI) WithImpl(impl AccountNetworkPolicyService) *AccountNetworkPolicyAPI
- type AccountNetworkPolicyMessage
- type AccountNetworkPolicyService
- type AccountSettingsAPI
- func (a *AccountSettingsAPI) DeletePersonalComputeSetting(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error)
- func (a *AccountSettingsAPI) Impl() AccountSettingsService
- func (a *AccountSettingsAPI) ReadPersonalComputeSetting(ctx context.Context, request ReadPersonalComputeSettingRequest) (*PersonalComputeSetting, error)
- func (a *AccountSettingsAPI) UpdatePersonalComputeSetting(ctx context.Context, request UpdatePersonalComputeSettingRequest) (*PersonalComputeSetting, error)
- func (a *AccountSettingsAPI) WithImpl(impl AccountSettingsService) *AccountSettingsAPI
- type AccountSettingsService
- type CreateIpAccessList
- type CreateIpAccessListResponse
- type CreateOboTokenRequest
- type CreateOboTokenResponse
- type CreateTokenRequest
- type CreateTokenResponse
- type CredentialsManagerAPI
- type CredentialsManagerService
- type DefaultNamespaceSetting
- type DeleteAccountIpAccessListRequest
- type DeleteAccountNetworkPolicyRequest
- type DeleteAccountNetworkPolicyResponse
- type DeleteDefaultWorkspaceNamespaceRequest
- type DeleteDefaultWorkspaceNamespaceResponse
- type DeleteIpAccessListRequest
- type DeletePersonalComputeSettingRequest
- type DeletePersonalComputeSettingResponse
- type DeleteTokenManagementRequest
- type ExchangeToken
- type ExchangeTokenRequest
- type ExchangeTokenResponse
- type FetchIpAccessListResponse
- type GetAccountIpAccessListRequest
- type GetIpAccessListRequest
- type GetIpAccessListResponse
- type GetIpAccessListsResponse
- type GetStatusRequest
- type GetTokenManagementRequest
- type GetTokenPermissionLevelsResponse
- type IpAccessListInfo
- type IpAccessListsAPI
- func (a *IpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
- func (a *IpAccessListsAPI) Delete(ctx context.Context, request DeleteIpAccessListRequest) error
- func (a *IpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error
- func (a *IpAccessListsAPI) Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error)
- func (a *IpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*FetchIpAccessListResponse, error)
- func (a *IpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)
- func (a *IpAccessListsAPI) Impl() IpAccessListsService
- func (a *IpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)
- func (a *IpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
- func (a *IpAccessListsAPI) Replace(ctx context.Context, request ReplaceIpAccessList) error
- func (a *IpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error
- func (a *IpAccessListsAPI) WithImpl(impl IpAccessListsService) *IpAccessListsAPI
- type IpAccessListsService
- type ListTokenManagementRequest
- type ListTokensResponse
- type ListType
- type PartitionId
- type PersonalComputeMessage
- type PersonalComputeMessageEnum
- type PersonalComputeSetting
- type PublicTokenInfo
- type ReadAccountNetworkPolicyRequest
- type ReadDefaultWorkspaceNamespaceRequest
- type ReadPersonalComputeSettingRequest
- type ReplaceIpAccessList
- type RevokeTokenRequest
- type SettingsAPI
- func (a *SettingsAPI) DeleteDefaultWorkspaceNamespace(ctx context.Context, request DeleteDefaultWorkspaceNamespaceRequest) (*DeleteDefaultWorkspaceNamespaceResponse, error)
- func (a *SettingsAPI) Impl() SettingsService
- func (a *SettingsAPI) ReadDefaultWorkspaceNamespace(ctx context.Context, request ReadDefaultWorkspaceNamespaceRequest) (*DefaultNamespaceSetting, error)
- func (a *SettingsAPI) UpdateDefaultWorkspaceNamespace(ctx context.Context, request UpdateDefaultWorkspaceNamespaceRequest) (*DefaultNamespaceSetting, error)
- func (a *SettingsAPI) WithImpl(impl SettingsService) *SettingsAPI
- type SettingsService
- type StringMessage
- type TokenAccessControlRequest
- type TokenAccessControlResponse
- type TokenInfo
- type TokenManagementAPI
- func (a *TokenManagementAPI) CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error)
- func (a *TokenManagementAPI) Delete(ctx context.Context, request DeleteTokenManagementRequest) error
- func (a *TokenManagementAPI) DeleteByTokenId(ctx context.Context, tokenId string) error
- func (a *TokenManagementAPI) Get(ctx context.Context, request GetTokenManagementRequest) (*TokenInfo, error)
- func (a *TokenManagementAPI) GetByComment(ctx context.Context, name string) (*TokenInfo, error)
- func (a *TokenManagementAPI) GetByTokenId(ctx context.Context, tokenId string) (*TokenInfo, error)
- func (a *TokenManagementAPI) GetPermissionLevels(ctx context.Context) (*GetTokenPermissionLevelsResponse, error)
- func (a *TokenManagementAPI) GetPermissions(ctx context.Context) (*TokenPermissions, error)
- func (a *TokenManagementAPI) Impl() TokenManagementService
- func (a *TokenManagementAPI) ListAll(ctx context.Context, request ListTokenManagementRequest) ([]TokenInfo, error)
- func (a *TokenManagementAPI) SetPermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)
- func (a *TokenManagementAPI) TokenInfoCommentToTokenIdMap(ctx context.Context, request ListTokenManagementRequest) (map[string]string, error)
- func (a *TokenManagementAPI) UpdatePermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)
- func (a *TokenManagementAPI) WithImpl(impl TokenManagementService) *TokenManagementAPI
- type TokenManagementService
- type TokenPermission
- type TokenPermissionLevel
- type TokenPermissions
- type TokenPermissionsDescription
- type TokenPermissionsRequest
- type TokenType
- type TokensAPI
- func (a *TokensAPI) Create(ctx context.Context, request CreateTokenRequest) (*CreateTokenResponse, error)
- func (a *TokensAPI) Delete(ctx context.Context, request RevokeTokenRequest) error
- func (a *TokensAPI) DeleteByTokenId(ctx context.Context, tokenId string) error
- func (a *TokensAPI) GetByComment(ctx context.Context, name string) (*TokenInfo, error)
- func (a *TokensAPI) Impl() TokensService
- func (a *TokensAPI) ListAll(ctx context.Context) ([]TokenInfo, error)
- func (a *TokensAPI) TokenInfoCommentToTokenIdMap(ctx context.Context) (map[string]string, error)
- func (a *TokensAPI) WithImpl(impl TokensService) *TokensAPI
- type TokensService
- type UpdateAccountNetworkPolicyRequest
- type UpdateDefaultWorkspaceNamespaceRequest
- type UpdateIpAccessList
- type UpdatePersonalComputeSettingRequest
- type WorkspaceConf
- type WorkspaceConfAPI
- func (a *WorkspaceConfAPI) GetStatus(ctx context.Context, request GetStatusRequest) (*map[string]string, error)
- func (a *WorkspaceConfAPI) Impl() WorkspaceConfService
- func (a *WorkspaceConfAPI) SetStatus(ctx context.Context, request WorkspaceConf) error
- func (a *WorkspaceConfAPI) WithImpl(impl WorkspaceConfService) *WorkspaceConfAPI
- type WorkspaceConfService
Examples ¶
- IpAccessListsAPI.Create (IpAccessLists)
- IpAccessListsAPI.Get (IpAccessLists)
- IpAccessListsAPI.ListAll (IpAccessLists)
- IpAccessListsAPI.Replace (IpAccessLists)
- TokenManagementAPI.CreateOboToken (CreateOboTokenOnAws)
- TokenManagementAPI.Get (CreateOboTokenOnAws)
- TokenManagementAPI.ListAll (CreateOboTokenOnAws)
- TokensAPI.Create (Tokens)
- TokensAPI.ListAll (Tokens)
- WorkspaceConfAPI.GetStatus (Repos)
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 ¶
func (a *AccountIpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
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 ¶
func (a *AccountIpAccessListsAPI) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error
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 ¶
func (a *AccountIpAccessListsAPI) Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error)
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 ¶
func (a *AccountIpAccessListsAPI) Impl() AccountIpAccessListsService
Impl returns low-level AccountIpAccessLists API implementation
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) ListAll ¶
func (a *AccountIpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
Get access lists.
Gets all IP access lists for the specified account.
This method is generated by Databricks SDK Code Generator.
func (*AccountIpAccessListsAPI) Replace ¶
func (a *AccountIpAccessListsAPI) 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.
func (*AccountIpAccessListsAPI) Update ¶
func (a *AccountIpAccessListsAPI) 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.
func (*AccountIpAccessListsAPI) WithImpl ¶
func (a *AccountIpAccessListsAPI) WithImpl(impl AccountIpAccessListsService) *AccountIpAccessListsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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 AccountNetworkPolicyAPI ¶ added in v0.14.0
type AccountNetworkPolicyAPI struct {
// contains filtered or unexported fields
}
Network policy is a set of rules that defines what can be accessed from your Databricks network. E.g.: You can choose to block your SQL UDF to access internet from your Databricks serverless clusters.
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 NewAccountNetworkPolicy ¶ added in v0.14.0
func NewAccountNetworkPolicy(client *client.DatabricksClient) *AccountNetworkPolicyAPI
func (*AccountNetworkPolicyAPI) DeleteAccountNetworkPolicy ¶ added in v0.14.0
func (a *AccountNetworkPolicyAPI) DeleteAccountNetworkPolicy(ctx context.Context, request DeleteAccountNetworkPolicyRequest) (*DeleteAccountNetworkPolicyResponse, error)
Delete Account Network Policy.
Reverts back all the account network policies back to default.
func (*AccountNetworkPolicyAPI) Impl ¶ added in v0.14.0
func (a *AccountNetworkPolicyAPI) Impl() AccountNetworkPolicyService
Impl returns low-level AccountNetworkPolicy API implementation
func (*AccountNetworkPolicyAPI) ReadAccountNetworkPolicy ¶ added in v0.14.0
func (a *AccountNetworkPolicyAPI) ReadAccountNetworkPolicy(ctx context.Context, request ReadAccountNetworkPolicyRequest) (*AccountNetworkPolicyMessage, error)
Get Account Network Policy.
Gets the value of Account level Network Policy.
func (*AccountNetworkPolicyAPI) UpdateAccountNetworkPolicy ¶ added in v0.14.0
func (a *AccountNetworkPolicyAPI) UpdateAccountNetworkPolicy(ctx context.Context, request UpdateAccountNetworkPolicyRequest) (*AccountNetworkPolicyMessage, error)
Update Account Network Policy.
Updates the policy content of Account level Network Policy.
func (*AccountNetworkPolicyAPI) WithImpl ¶ added in v0.14.0
func (a *AccountNetworkPolicyAPI) WithImpl(impl AccountNetworkPolicyService) *AccountNetworkPolicyAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type AccountNetworkPolicyMessage ¶ added in v0.14.0
type AccountNetworkPolicyMessage struct {
// Whether or not serverless UDF can access the internet. When false, access
// to the internet will be blocked from serverless clusters. Trusted traffic
// required by clusters for basic functionality will not be affected.
ServerlessInternetAccessEnabled bool `json:"serverless_internet_access_enabled,omitempty"`
}
type AccountNetworkPolicyService ¶ added in v0.14.0
type AccountNetworkPolicyService interface {
// Delete Account Network Policy.
//
// Reverts back all the account network policies back to default.
DeleteAccountNetworkPolicy(ctx context.Context, request DeleteAccountNetworkPolicyRequest) (*DeleteAccountNetworkPolicyResponse, error)
// Get Account Network Policy.
//
// Gets the value of Account level Network Policy.
ReadAccountNetworkPolicy(ctx context.Context, request ReadAccountNetworkPolicyRequest) (*AccountNetworkPolicyMessage, error)
// Update Account Network Policy.
//
// Updates the policy content of Account level Network Policy.
UpdateAccountNetworkPolicy(ctx context.Context, request UpdateAccountNetworkPolicyRequest) (*AccountNetworkPolicyMessage, error)
}
Network policy is a set of rules that defines what can be accessed from your Databricks network. E.g.: You can choose to block your SQL UDF to access internet from your Databricks serverless clusters.
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 AccountSettingsAPI ¶ added in v0.10.0
type AccountSettingsAPI 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 NewAccountSettings ¶ added in v0.10.0
func NewAccountSettings(client *client.DatabricksClient) *AccountSettingsAPI
func (*AccountSettingsAPI) DeletePersonalComputeSetting ¶ added in v0.11.0
func (a *AccountSettingsAPI) DeletePersonalComputeSetting(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error)
Delete Personal Compute setting.
Reverts back the Personal Compute setting value to default (ON)
func (*AccountSettingsAPI) Impl ¶ added in v0.10.0
func (a *AccountSettingsAPI) Impl() AccountSettingsService
Impl returns low-level AccountSettings API implementation
func (*AccountSettingsAPI) ReadPersonalComputeSetting ¶ added in v0.10.0
func (a *AccountSettingsAPI) ReadPersonalComputeSetting(ctx context.Context, request ReadPersonalComputeSettingRequest) (*PersonalComputeSetting, error)
Get Personal Compute setting.
Gets the value of the Personal Compute setting.
func (*AccountSettingsAPI) UpdatePersonalComputeSetting ¶ added in v0.11.0
func (a *AccountSettingsAPI) UpdatePersonalComputeSetting(ctx context.Context, request UpdatePersonalComputeSettingRequest) (*PersonalComputeSetting, error)
Update Personal Compute setting.
Updates the value of the Personal Compute setting.
func (*AccountSettingsAPI) WithImpl ¶ added in v0.10.0
func (a *AccountSettingsAPI) WithImpl(impl AccountSettingsService) *AccountSettingsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type AccountSettingsService ¶ added in v0.10.0
type AccountSettingsService interface {
// Delete Personal Compute setting.
//
// Reverts back the Personal Compute setting value to default (ON)
DeletePersonalComputeSetting(ctx context.Context, request DeletePersonalComputeSettingRequest) (*DeletePersonalComputeSettingResponse, error)
// Get Personal Compute setting.
//
// Gets the value of the Personal Compute setting.
ReadPersonalComputeSetting(ctx context.Context, request ReadPersonalComputeSettingRequest) (*PersonalComputeSetting, error)
// Update Personal Compute setting.
//
// Updates the value of the Personal Compute setting.
UpdatePersonalComputeSetting(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 CreateIpAccessList ¶
type CreateIpAccessList struct {
// Array of IP addresses or CIDR values to be added to the IP access list.
IpAddresses []string `json:"ip_addresses"`
// 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"`
}
type CreateIpAccessListResponse ¶
type CreateIpAccessListResponse struct {
IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}
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"`
}
type CreateOboTokenResponse ¶
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 ifetime is not specified, this token remains valid indefinitely.
LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"`
}
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"`
}
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
func (a *CredentialsManagerAPI) ExchangeToken(ctx context.Context, request ExchangeTokenRequest) (*ExchangeTokenResponse, error)
Exchange token.
Exchange tokens with an Identity Provider to get a new access token. It allowes specifying scopes to determine token permissions.
func (*CredentialsManagerAPI) Impl ¶ added in v0.20.0
func (a *CredentialsManagerAPI) Impl() CredentialsManagerService
Impl returns low-level CredentialsManager API implementation
func (*CredentialsManagerAPI) WithImpl ¶ added in v0.20.0
func (a *CredentialsManagerAPI) WithImpl(impl CredentialsManagerService) *CredentialsManagerAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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
// allowes 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 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.
SettingName string `json:"setting_name,omitempty"`
}
Default namespace setting.
type DeleteAccountIpAccessListRequest ¶
type DeleteAccountIpAccessListRequest struct {
// The ID for the corresponding IP access list.
IpAccessListId string `json:"-" url:"-"`
}
Delete access list
type DeleteAccountNetworkPolicyRequest ¶ added in v0.14.0
type DeleteAccountNetworkPolicyRequest 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"`
}
Delete Account Network Policy
type DeleteAccountNetworkPolicyResponse ¶ added in v0.14.0
type DeleteAccountNetworkPolicyResponse 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"`
}
type DeleteDefaultWorkspaceNamespaceRequest ¶ added in v0.21.0
type DeleteDefaultWorkspaceNamespaceRequest 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"`
}
Delete the default namespace
type DeleteDefaultWorkspaceNamespaceResponse ¶ added in v0.21.0
type DeleteDefaultWorkspaceNamespaceResponse 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"`
}
type DeleteIpAccessListRequest ¶
type DeleteIpAccessListRequest struct {
// The ID for the corresponding IP access list to modify.
IpAccessListId string `json:"-" url:"-"`
}
Delete access list
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"`
}
Delete Personal Compute setting
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 ->
// 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"`
}
type DeleteTokenManagementRequest ¶
type DeleteTokenManagementRequest struct {
// The ID of the token to get.
TokenId string `json:"-" url:"-"`
}
Delete a token
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 token request. As of now, only `AZURE_ACTIVE_DIRECTORY_TOKEN`
// is supported.
TokenType TokenType `json:"tokenType,omitempty"`
}
type ExchangeTokenRequest ¶ added in v0.20.0
type ExchangeTokenRequest struct {
PartitionId PartitionId `json:"partitionId"`
// Array of scopes for the token request.
Scopes []string `json:"scopes"`
TokenType []TokenType `json:"tokenType"`
}
type ExchangeTokenResponse ¶ added in v0.20.0
type ExchangeTokenResponse struct {
Values []ExchangeToken `json:"values,omitempty"`
}
type FetchIpAccessListResponse ¶
type FetchIpAccessListResponse struct {
IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}
type GetAccountIpAccessListRequest ¶
type GetAccountIpAccessListRequest struct {
// The ID for the corresponding IP access list.
IpAccessListId string `json:"-" url:"-"`
}
Get IP access list
type GetIpAccessListRequest ¶
type GetIpAccessListRequest struct {
// The ID for the corresponding IP access list to modify.
IpAccessListId string `json:"-" url:"-"`
}
Get access list
type GetIpAccessListResponse ¶
type GetIpAccessListResponse struct {
IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}
type GetIpAccessListsResponse ¶
type GetIpAccessListsResponse struct {
IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}
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 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"`
// Array of IP addresses or CIDR values to be added to the IP access list.
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"`
}
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 ¶
func (a *IpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
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)
}
func (*IpAccessListsAPI) Delete ¶
func (a *IpAccessListsAPI) Delete(ctx context.Context, request DeleteIpAccessListRequest) error
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 ¶
func (a *IpAccessListsAPI) Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error)
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)
}
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 ¶
func (a *IpAccessListsAPI) Impl() IpAccessListsService
Impl returns low-level IpAccessLists API implementation
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) 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)
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)
}
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 ¶
func (a *IpAccessListsAPI) WithImpl(impl IpAccessListsService) *IpAccessListsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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) (*GetIpAccessListResponse, 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 ListTokenManagementRequest ¶
type ListTokenManagementRequest struct {
// User ID of the user that created the token.
CreatedById string `json:"-" url:"created_by_id,omitempty"`
// Username of the user that created the token.
CreatedByUsername string `json:"-" url:"created_by_username,omitempty"`
}
List all tokens
type ListTokensResponse ¶
type ListTokensResponse struct {
TokenInfos []TokenInfo `json:"token_infos,omitempty"`
}
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.
type PartitionId ¶ added in v0.21.0
type PartitionId struct {
// The ID of the workspace.
WorkspaceId int64 `json:"workspaceId,omitempty"`
}
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
func (f *PersonalComputeMessageEnum) Set(v string) error
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
func (f *PersonalComputeMessageEnum) Type() string
Type always returns PersonalComputeMessageEnum to satisfy [pflag.Value] interface
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. Needs to be 'default' if there is only
// one setting instance per account.
SettingName string `json:"setting_name,omitempty"`
}
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"`
}
type ReadAccountNetworkPolicyRequest ¶ added in v0.14.0
type ReadAccountNetworkPolicyRequest 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"`
}
Get Account Network Policy
type ReadDefaultWorkspaceNamespaceRequest ¶ added in v0.21.0
type ReadDefaultWorkspaceNamespaceRequest 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"`
}
Get the default namespace
type ReadPersonalComputeSettingRequest ¶ added in v0.10.0
type ReadPersonalComputeSettingRequest 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"`
}
Get Personal Compute setting
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 to modify.
IpAccessListId string `json:"-" url:"-"`
// Array of IP addresses or CIDR values to be added to the IP access list.
IpAddresses []string `json:"ip_addresses"`
// Label for the IP access list. This **cannot** be empty.
Label string `json:"label"`
// 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"`
}
type RevokeTokenRequest ¶
type RevokeTokenRequest struct {
// The ID of the token to be revoked.
TokenId string `json:"token_id"`
}
type SettingsAPI ¶ added in v0.21.0
type SettingsAPI struct {
// contains filtered or unexported fields
}
// TODO(yuyuan.tang) to add the description for the setting
func NewSettings ¶ added in v0.21.0
func NewSettings(client *client.DatabricksClient) *SettingsAPI
func (*SettingsAPI) DeleteDefaultWorkspaceNamespace ¶ added in v0.21.0
func (a *SettingsAPI) DeleteDefaultWorkspaceNamespace(ctx context.Context, request DeleteDefaultWorkspaceNamespaceRequest) (*DeleteDefaultWorkspaceNamespaceResponse, error)
Delete the default namespace.
Deletes the default namespace.
func (*SettingsAPI) Impl ¶ added in v0.21.0
func (a *SettingsAPI) Impl() SettingsService
Impl returns low-level Settings API implementation
func (*SettingsAPI) ReadDefaultWorkspaceNamespace ¶ added in v0.21.0
func (a *SettingsAPI) ReadDefaultWorkspaceNamespace(ctx context.Context, request ReadDefaultWorkspaceNamespaceRequest) (*DefaultNamespaceSetting, error)
Get the default namespace.
Gets the default namespace.
func (*SettingsAPI) UpdateDefaultWorkspaceNamespace ¶ added in v0.21.0
func (a *SettingsAPI) UpdateDefaultWorkspaceNamespace(ctx context.Context, request UpdateDefaultWorkspaceNamespaceRequest) (*DefaultNamespaceSetting, error)
Updates the default namespace setting.
Updates the default namespace setting for the workspace. A fresh etag needs to be provided in PATCH requests (as part 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 will return a NOT_FOUND error and the etag will be present in the error response, which should be set in the PATCH request.
func (*SettingsAPI) WithImpl ¶ added in v0.21.0
func (a *SettingsAPI) WithImpl(impl SettingsService) *SettingsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type SettingsService ¶ added in v0.21.0
type SettingsService interface {
// Delete the default namespace.
//
// Deletes the default namespace.
DeleteDefaultWorkspaceNamespace(ctx context.Context, request DeleteDefaultWorkspaceNamespaceRequest) (*DeleteDefaultWorkspaceNamespaceResponse, error)
// Get the default namespace.
//
// Gets the default namespace.
ReadDefaultWorkspaceNamespace(ctx context.Context, request ReadDefaultWorkspaceNamespaceRequest) (*DefaultNamespaceSetting, error)
// Updates the default namespace setting.
//
// Updates the default namespace setting for the workspace. A fresh etag
// needs to be provided in PATCH requests (as part 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 will return a NOT_FOUND
// error and the etag will be present in the error response, which should be
// set in the PATCH request.
UpdateDefaultWorkspaceNamespace(ctx context.Context, request UpdateDefaultWorkspaceNamespaceRequest) (*DefaultNamespaceSetting, error)
}
// TODO(yuyuan.tang) to add the description for the setting
type StringMessage ¶ added in v0.21.0
type StringMessage struct {
// Represents a generic string value.
Value string `json:"value,omitempty"`
}
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"`
// name of the service principal
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
}
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"`
}
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"`
}
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 ¶
func (a *TokenManagementAPI) CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error)
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)
}
func (*TokenManagementAPI) Delete ¶
func (a *TokenManagementAPI) Delete(ctx context.Context, request DeleteTokenManagementRequest) error
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 ¶
func (a *TokenManagementAPI) Get(ctx context.Context, request GetTokenManagementRequest) (*TokenInfo, error)
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)
}
func (*TokenManagementAPI) GetByComment ¶
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 ¶
Get token info.
Gets information about a token, specified by its ID.
func (*TokenManagementAPI) GetPermissionLevels ¶ added in v0.19.0
func (a *TokenManagementAPI) GetPermissionLevels(ctx context.Context) (*GetTokenPermissionLevelsResponse, error)
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 ¶
func (a *TokenManagementAPI) Impl() TokenManagementService
Impl returns low-level TokenManagement API implementation
func (*TokenManagementAPI) ListAll ¶
func (a *TokenManagementAPI) ListAll(ctx context.Context, request ListTokenManagementRequest) ([]TokenInfo, error)
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)
func (*TokenManagementAPI) SetPermissions ¶ added in v0.19.0
func (a *TokenManagementAPI) SetPermissions(ctx context.Context, request TokenPermissionsRequest) (*TokenPermissions, error)
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 ¶
func (a *TokenManagementAPI) WithImpl(impl TokenManagementService) *TokenManagementAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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) (*TokenInfo, 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"`
}
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"`
}
type TokenPermissionsDescription ¶ added in v0.15.0
type TokenPermissionsDescription struct {
Description string `json:"description,omitempty"`
// Permission level
PermissionLevel TokenPermissionLevel `json:"permission_level,omitempty"`
}
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
Set raw string value and validate it against allowed values
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 ¶
func (a *TokensAPI) Create(ctx context.Context, request CreateTokenRequest) (*CreateTokenResponse, error)
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)
}
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 ¶
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 ¶
GetByComment calls TokensAPI.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 (*TokensAPI) Impl ¶
func (a *TokensAPI) Impl() TokensService
Impl returns low-level Tokens API implementation
func (*TokensAPI) ListAll ¶
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)
func (*TokensAPI) TokenInfoCommentToTokenIdMap ¶ added in v0.9.0
TokenInfoCommentToTokenIdMap calls TokensAPI.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 (*TokensAPI) WithImpl ¶
func (a *TokensAPI) WithImpl(impl TokensService) *TokensAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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 TokenInfo instances
List(ctx context.Context) (*ListTokensResponse, error)
}
The Token API allows you to create, list, and revoke tokens that can be used to authenticate and access Databricks REST APIs.
type UpdateAccountNetworkPolicyRequest ¶ added in v0.14.0
type UpdateAccountNetworkPolicyRequest struct {
// This should always be set to true for Settings RPCs. Added for AIP
// compliance.
AllowMissing bool `json:"allow_missing,omitempty"`
Setting *AccountNetworkPolicyMessage `json:"setting,omitempty"`
}
Update Account Network Policy
type UpdateDefaultWorkspaceNamespaceRequest ¶ added in v0.21.0
type UpdateDefaultWorkspaceNamespaceRequest struct {
// This should always be set to true for Settings RPCs. Added for AIP
// compliance.
AllowMissing bool `json:"allow_missing,omitempty"`
// Field mask required to be passed into the PATCH request. Field mask
// specifies which fields of the setting payload will be updated. For
// example, for Default Namespace setting, the field mask is supposed to
// contain fields from the DefaultNamespaceSetting.namespace schema.
//
// The field mask needs to supplied as single string. To specify multiple
// fields in the field mask, use comma as the seperator (no space).
FieldMask string `json:"field_mask,omitempty"`
// Default namespace setting.
Setting *DefaultNamespaceSetting `json:"setting,omitempty"`
}
Updates the default namespace setting
type UpdateIpAccessList ¶
type UpdateIpAccessList struct {
// Specifies whether this IP access list is enabled.
Enabled bool `json:"enabled"`
// The ID for the corresponding IP access list to modify.
IpAccessListId string `json:"-" url:"-"`
// Array of IP addresses or CIDR values to be added to the IP access list.
IpAddresses []string `json:"ip_addresses"`
// Label for the IP access list. This **cannot** be empty.
Label string `json:"label"`
// 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"`
}
type UpdatePersonalComputeSettingRequest ¶ added in v0.11.0
type UpdatePersonalComputeSettingRequest struct {
// This should always be set to true for Settings RPCs. Added for AIP
// compliance.
AllowMissing bool `json:"allow_missing,omitempty"`
Setting *PersonalComputeSetting `json:"setting,omitempty"`
}
Update Personal Compute setting
type WorkspaceConf ¶
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)
func (*WorkspaceConfAPI) Impl ¶
func (a *WorkspaceConfAPI) Impl() WorkspaceConfService
Impl returns low-level WorkspaceConf API implementation
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 ¶
func (a *WorkspaceConfAPI) WithImpl(impl WorkspaceConfService) *WorkspaceConfAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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.