Documentation
¶
Overview ¶
These APIs allow you to manage Account Ip Access Lists, Account Network Policy, Account Settings, Credentials Manager, Ip Access Lists, Network Connectivity, 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) List(ctx context.Context) ...
- 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 CreateNetworkConnectivityConfigRequest
- type CreateOboTokenRequest
- type CreateOboTokenResponse
- type CreatePrivateEndpointRuleRequest
- type CreatePrivateEndpointRuleRequestGroupId
- type CreateTokenRequest
- type CreateTokenResponse
- type CredentialsManagerAPI
- type CredentialsManagerService
- type DefaultNamespaceSetting
- type DeleteAccountIpAccessListRequest
- type DeleteAccountNetworkPolicyRequest
- type DeleteAccountNetworkPolicyResponse
- type DeleteDefaultWorkspaceNamespaceRequest
- type DeleteDefaultWorkspaceNamespaceResponse
- type DeleteIpAccessListRequest
- type DeleteNetworkConnectivityConfigurationRequest
- type DeletePersonalComputeSettingRequest
- type DeletePersonalComputeSettingResponse
- type DeletePrivateEndpointRuleRequest
- type DeleteTokenManagementRequest
- type ExchangeToken
- type ExchangeTokenRequest
- type ExchangeTokenResponse
- type FetchIpAccessListResponse
- type GetAccountIpAccessListRequest
- type GetIpAccessListRequest
- type GetIpAccessListResponse
- type GetIpAccessListsResponse
- type GetNetworkConnectivityConfigurationRequest
- type GetPrivateEndpointRuleRequest
- 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) List(ctx context.Context) ...
- 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 ListIpAccessListResponse
- type ListNccAzurePrivateEndpointRulesResponse
- type ListNetworkConnectivityConfigurationsRequest
- type ListNetworkConnectivityConfigurationsResponse
- type ListPrivateEndpointRulesRequest
- type ListTokenManagementRequest
- type ListTokensResponse
- type ListType
- type NccAzurePrivateEndpointRule
- type NccAzurePrivateEndpointRuleConnectionState
- type NccAzurePrivateEndpointRuleGroupId
- type NccAzureServiceEndpointRule
- type NccEgressConfig
- type NccEgressDefaultRules
- type NccEgressTargetRules
- type NetworkConnectivityAPI
- func (a *NetworkConnectivityAPI) CreateNetworkConnectivityConfiguration(ctx context.Context, request CreateNetworkConnectivityConfigRequest) (*NetworkConnectivityConfiguration, error)
- func (a *NetworkConnectivityAPI) CreatePrivateEndpointRule(ctx context.Context, request CreatePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)
- func (a *NetworkConnectivityAPI) DeleteNetworkConnectivityConfiguration(ctx context.Context, request DeleteNetworkConnectivityConfigurationRequest) error
- func (a *NetworkConnectivityAPI) DeleteNetworkConnectivityConfigurationByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) error
- func (a *NetworkConnectivityAPI) DeletePrivateEndpointRule(ctx context.Context, request DeletePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)
- func (a *NetworkConnectivityAPI) DeletePrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId(ctx context.Context, networkConnectivityConfigId string, ...) (*NccAzurePrivateEndpointRule, error)
- func (a *NetworkConnectivityAPI) GetNetworkConnectivityConfiguration(ctx context.Context, request GetNetworkConnectivityConfigurationRequest) (*NetworkConnectivityConfiguration, error)
- func (a *NetworkConnectivityAPI) GetNetworkConnectivityConfigurationByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) (*NetworkConnectivityConfiguration, error)
- func (a *NetworkConnectivityAPI) GetPrivateEndpointRule(ctx context.Context, request GetPrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)
- func (a *NetworkConnectivityAPI) GetPrivateEndpointRuleByNetworkConnectivityConfigIdAndPrivateEndpointRuleId(ctx context.Context, networkConnectivityConfigId string, ...) (*NccAzurePrivateEndpointRule, error)
- func (a *NetworkConnectivityAPI) Impl() NetworkConnectivityService
- func (a *NetworkConnectivityAPI) ListNetworkConnectivityConfigurations(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) ...
- func (a *NetworkConnectivityAPI) ListNetworkConnectivityConfigurationsAll(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) ([]NetworkConnectivityConfiguration, error)
- func (a *NetworkConnectivityAPI) ListPrivateEndpointRules(ctx context.Context, request ListPrivateEndpointRulesRequest) ...
- func (a *NetworkConnectivityAPI) ListPrivateEndpointRulesAll(ctx context.Context, request ListPrivateEndpointRulesRequest) ([]NccAzurePrivateEndpointRule, error)
- func (a *NetworkConnectivityAPI) ListPrivateEndpointRulesByNetworkConnectivityConfigId(ctx context.Context, networkConnectivityConfigId string) (*ListNccAzurePrivateEndpointRulesResponse, error)
- func (a *NetworkConnectivityAPI) WithImpl(impl NetworkConnectivityService) *NetworkConnectivityAPI
- type NetworkConnectivityConfiguration
- type NetworkConnectivityService
- 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) List(ctx context.Context, request ListTokenManagementRequest) ...
- 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) List(ctx context.Context) *listing.PaginatingIterator[struct{}, *ListTokensResponse, TokenInfo]
- 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) List ¶ added in v0.24.0
func (a *AccountIpAccessListsAPI) List(ctx context.Context) *listing.PaginatingIterator[struct{}, *GetIpAccessListsResponse, IpAccessListInfo]
Get access lists.
Gets all IP access lists for the specified account.
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"`
ForceSendFields []string `json:"-"`
}
func (AccountNetworkPolicyMessage) MarshalJSON ¶ added in v0.24.0
func (s AccountNetworkPolicyMessage) MarshalJSON() ([]byte, error)
func (*AccountNetworkPolicyMessage) UnmarshalJSON ¶ added in v0.24.0
func (s *AccountNetworkPolicyMessage) UnmarshalJSON(b []byte) error
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 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 Azure region for this network connectivity configuration. Only
// workspaces in the same Azure region can be attached to this 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"`
ForceSendFields []string `json:"-"`
}
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:"-"`
}
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
func (f *CreatePrivateEndpointRuleRequestGroupId) Set(v string) error
Set raw string value and validate it against allowed values
func (*CreatePrivateEndpointRuleRequestGroupId) String ¶ added in v0.25.0
func (f *CreatePrivateEndpointRuleRequestGroupId) String() string
String representation for fmt.Print
func (*CreatePrivateEndpointRuleRequestGroupId) Type ¶ added in v0.25.0
func (f *CreatePrivateEndpointRuleRequestGroupId) Type() string
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 ifetime 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
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.
// 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 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 setting
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 DeleteNetworkConnectivityConfigurationRequest ¶ added in v0.25.0
type DeleteNetworkConnectivityConfigurationRequest struct {
// Your Network Connectvity Configuration ID.
NetworkConnectivityConfigId string `json:"-" url:"-"`
}
Delete a network connectivity configuration
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 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 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"`
ForceSendFields []string `json:"-"`
}
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 {
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 {
IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}
type GetIpAccessListsResponse ¶
type GetIpAccessListsResponse struct {
IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}
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 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 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"`
ForceSendFields []string `json:"-"`
}
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 ¶
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) List ¶ added in v0.24.0
func (a *IpAccessListsAPI) List(ctx context.Context) *listing.PaginatingIterator[struct{}, *ListIpAccessListResponse, IpAccessListInfo]
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)
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) (*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"`
}
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 (s ListNccAzurePrivateEndpointRulesResponse) MarshalJSON() ([]byte, error)
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 (s ListNetworkConnectivityConfigurationsRequest) MarshalJSON() ([]byte, error)
func (*ListNetworkConnectivityConfigurationsRequest) UnmarshalJSON ¶ added in v0.26.0
func (s *ListNetworkConnectivityConfigurationsRequest) UnmarshalJSON(b []byte) error
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 (s ListNetworkConnectivityConfigurationsResponse) MarshalJSON() ([]byte, error)
func (*ListNetworkConnectivityConfigurationsResponse) UnmarshalJSON ¶ added in v0.26.0
func (s *ListNetworkConnectivityConfigurationsResponse) UnmarshalJSON(b []byte) error
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 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"`
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 {
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 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
func (f *NccAzurePrivateEndpointRuleConnectionState) Set(v string) error
Set raw string value and validate it against allowed values
func (*NccAzurePrivateEndpointRuleConnectionState) String ¶ added in v0.25.0
func (f *NccAzurePrivateEndpointRuleConnectionState) String() string
String representation for fmt.Print
func (*NccAzurePrivateEndpointRuleConnectionState) Type ¶ added in v0.25.0
func (f *NccAzurePrivateEndpointRuleConnectionState) Type() string
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
func (f *NccAzurePrivateEndpointRuleGroupId) Set(v string) error
Set raw string value and validate it against allowed values
func (*NccAzurePrivateEndpointRuleGroupId) String ¶ added in v0.25.0
func (f *NccAzurePrivateEndpointRuleGroupId) String() string
String representation for fmt.Print
func (*NccAzurePrivateEndpointRuleGroupId) Type ¶ added in v0.25.0
func (f *NccAzurePrivateEndpointRuleGroupId) Type() string
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 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. This API provides stable subnets for your workspace so that you can configure your firewalls on your Azure Storage accounts to allow access from Databricks. You can also use the API to provision private endpoints for Databricks to privately connect serverless compute resources to your Azure resources using Azure Private Link. See configure serverless secure connectivity.
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.
Creates a network connectivity configuration (NCC), which provides stable Azure service subnets when accessing your Azure Storage accounts. You can also use a network connectivity configuration to create Databricks-managed private endpoints so that Databricks serverless compute resources privately access your resources.
**IMPORTANT**: After you create the network connectivity configuration, you must assign one or more workspaces to the new network connectivity configuration. You can share one network connectivity configuration with multiple workspaces from the same Azure region within the same Databricks account. See configure serverless secure connectivity.
func (*NetworkConnectivityAPI) CreatePrivateEndpointRule ¶ added in v0.25.0
func (a *NetworkConnectivityAPI) CreatePrivateEndpointRule(ctx context.Context, request CreatePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, 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.
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
func (a *NetworkConnectivityAPI) DeletePrivateEndpointRule(ctx context.Context, request DeletePrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)
Delete a private endpoint rule.
Initiates deleting a private endpoint rule. The private endpoint will be deactivated and will be purged after seven days of deactivation. When a private endpoint is in deactivated state, `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. The private endpoint will be deactivated and will be purged after seven days of deactivation. When a private endpoint is in deactivated state, `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
func (a *NetworkConnectivityAPI) GetNetworkConnectivityConfiguration(ctx context.Context, request GetNetworkConnectivityConfigurationRequest) (*NetworkConnectivityConfiguration, error)
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
func (a *NetworkConnectivityAPI) GetPrivateEndpointRule(ctx context.Context, request GetPrivateEndpointRuleRequest) (*NccAzurePrivateEndpointRule, error)
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
func (a *NetworkConnectivityAPI) Impl() NetworkConnectivityService
Impl returns low-level NetworkConnectivity API implementation
func (*NetworkConnectivityAPI) ListNetworkConnectivityConfigurations ¶ added in v0.26.0
func (a *NetworkConnectivityAPI) ListNetworkConnectivityConfigurations(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) *listing.PaginatingIterator[ListNetworkConnectivityConfigurationsRequest, *ListNetworkConnectivityConfigurationsResponse, NetworkConnectivityConfiguration]
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
func (a *NetworkConnectivityAPI) ListNetworkConnectivityConfigurationsAll(ctx context.Context, request ListNetworkConnectivityConfigurationsRequest) ([]NetworkConnectivityConfiguration, error)
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
func (a *NetworkConnectivityAPI) ListPrivateEndpointRules(ctx context.Context, request ListPrivateEndpointRulesRequest) *listing.PaginatingIterator[ListPrivateEndpointRulesRequest, *ListNccAzurePrivateEndpointRulesResponse, NccAzurePrivateEndpointRule]
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
func (a *NetworkConnectivityAPI) ListPrivateEndpointRulesAll(ctx context.Context, request ListPrivateEndpointRulesRequest) ([]NccAzurePrivateEndpointRule, error)
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
func (a *NetworkConnectivityAPI) WithImpl(impl NetworkConnectivityService) *NetworkConnectivityAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
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 Azure region for this network connectivity configuration. Only
// workspaces in the same Azure region can be attached to this 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 NetworkConnectivityService ¶ added in v0.25.0
type NetworkConnectivityService interface {
// Create a network connectivity configuration.
//
// Creates a network connectivity configuration (NCC), which provides stable
// Azure service subnets when accessing your Azure Storage accounts. You can
// also use a network connectivity configuration to create
// Databricks-managed private endpoints so that Databricks serverless
// compute resources privately access your resources.
//
// **IMPORTANT**: After you create the network connectivity configuration,
// you must assign one or more workspaces to the new network connectivity
// configuration. You can share one network connectivity configuration with
// multiple workspaces from the same Azure region within the same Databricks
// account. See [configure serverless secure connectivity].
//
// [configure serverless secure connectivity]: https://learn.microsoft.com/azure/databricks/security/network/serverless-network-security
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. The private endpoint will be
// deactivated and will be purged after seven days of deactivation. When a
// private endpoint is in deactivated state, `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. This API provides stable subnets for your workspace so that you can configure your firewalls on your Azure Storage accounts to allow access from Databricks. You can also use the API to provision private endpoints for Databricks to privately connect serverless compute resources to your Azure resources using Azure Private Link. See configure serverless secure connectivity.
type PartitionId ¶ added in v0.21.0
type PartitionId struct {
// The ID of the workspace.
WorkspaceId int64 `json:"workspaceId,omitempty"`
ForceSendFields []string `json:"-"`
}
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 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. 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"`
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 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 setting
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"`
ForceSendFields []string `json:"-"`
}
func (ReplaceIpAccessList) MarshalJSON ¶ added in v0.23.0
func (s ReplaceIpAccessList) MarshalJSON() ([]byte, error)
func (*ReplaceIpAccessList) UnmarshalJSON ¶ added in v0.23.0
func (s *ReplaceIpAccessList) UnmarshalJSON(b []byte) error
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
}
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 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 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 will fail with 409 and the request will need to be retried by using the fresh etag in the 409 response.
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 setting.
Gets the default namespace setting.
func (*SettingsAPI) UpdateDefaultWorkspaceNamespace ¶ added in v0.21.0
func (a *SettingsAPI) UpdateDefaultWorkspaceNamespace(ctx context.Context, request UpdateDefaultWorkspaceNamespaceRequest) (*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 will return a NOT_FOUND error and the etag will be present in the error response, which should be set in the PATCH request. If the setting is updated concurrently, PATCH will fail with 409 and the request will need to be retried by using the fresh etag in the 409 response.
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 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 will fail with 409
// and the request will need to be retried by using the fresh etag in the
// 409 response.
DeleteDefaultWorkspaceNamespace(ctx context.Context, request DeleteDefaultWorkspaceNamespaceRequest) (*DeleteDefaultWorkspaceNamespaceResponse, error)
// Get the default namespace setting.
//
// Gets the default namespace setting.
ReadDefaultWorkspaceNamespace(ctx context.Context, request ReadDefaultWorkspaceNamespaceRequest) (*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 will return a
// NOT_FOUND error and the etag will be present in the error response, which
// should be set in the PATCH request. If the setting is updated
// concurrently, PATCH will fail with 409 and the request will need to be
// retried by using the fresh etag in the 409 response.
UpdateDefaultWorkspaceNamespace(ctx context.Context, request UpdateDefaultWorkspaceNamespaceRequest) (*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 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 an active service principal. Setting this field
// requires the `servicePrincipal/user` role.
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 (*TokenInfo) UnmarshalJSON ¶ added in v0.23.0
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) List ¶ added in v0.24.0
func (a *TokenManagementAPI) List(ctx context.Context, request ListTokenManagementRequest) *listing.PaginatingIterator[ListTokenManagementRequest, *ListTokensResponse, TokenInfo]
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 ¶
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"`
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
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) List ¶ added in v0.24.0
func (a *TokensAPI) List(ctx context.Context) *listing.PaginatingIterator[struct{}, *ListTokensResponse, TokenInfo]
List tokens.
Lists all the valid tokens for a user-workspace pair.
This method is generated by Databricks SDK Code Generator.
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"`
ForceSendFields []string `json:"-"`
}
Update Account Network Policy
func (UpdateAccountNetworkPolicyRequest) MarshalJSON ¶ added in v0.24.0
func (s UpdateAccountNetworkPolicyRequest) MarshalJSON() ([]byte, error)
func (*UpdateAccountNetworkPolicyRequest) UnmarshalJSON ¶ added in v0.24.0
func (s *UpdateAccountNetworkPolicyRequest) UnmarshalJSON(b []byte) error
type UpdateDefaultWorkspaceNamespaceRequest ¶ added in v0.21.0
type UpdateDefaultWorkspaceNamespaceRequest struct {
// This should always be set to true for Settings API. Added for AIP
// compliance.
AllowMissing bool `json:"allow_missing,omitempty"`
// Field mask is 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 be 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"`
// 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,omitempty"`
ForceSendFields []string `json:"-"`
}
Update the default namespace setting
func (UpdateDefaultWorkspaceNamespaceRequest) MarshalJSON ¶ added in v0.23.0
func (s UpdateDefaultWorkspaceNamespaceRequest) MarshalJSON() ([]byte, error)
func (*UpdateDefaultWorkspaceNamespaceRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *UpdateDefaultWorkspaceNamespaceRequest) UnmarshalJSON(b []byte) error
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"`
ForceSendFields []string `json:"-"`
}
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 RPCs. Added for AIP
// compliance.
AllowMissing bool `json:"allow_missing,omitempty"`
Setting *PersonalComputeSetting `json:"setting,omitempty"`
ForceSendFields []string `json:"-"`
}
Update Personal Compute setting
func (UpdatePersonalComputeSettingRequest) MarshalJSON ¶ added in v0.23.0
func (s UpdatePersonalComputeSettingRequest) MarshalJSON() ([]byte, error)
func (*UpdatePersonalComputeSettingRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *UpdatePersonalComputeSettingRequest) UnmarshalJSON(b []byte) error
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.