Documentation ¶
Overview ¶
These APIs allow you to manage Account Ip Access Lists, Ip Access Lists, Token Management, Tokens, Workspace Conf, etc.
Index ¶
- type AccountIpAccessListsAPI
- func (a *AccountIpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
- func (a *AccountIpAccessListsAPI) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error
- func (a *AccountIpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error
- func (a *AccountIpAccessListsAPI) Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error)
- func (a *AccountIpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*GetIpAccessListResponse, error)
- func (a *AccountIpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)
- func (a *AccountIpAccessListsAPI) Impl() AccountIpAccessListsService
- func (a *AccountIpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)
- func (a *AccountIpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
- func (a *AccountIpAccessListsAPI) Replace(ctx context.Context, request ReplaceIpAccessList) error
- func (a *AccountIpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error
- func (a *AccountIpAccessListsAPI) WithImpl(impl AccountIpAccessListsService) *AccountIpAccessListsAPI
- type AccountIpAccessListsService
- type CreateIpAccessList
- type CreateIpAccessListResponse
- type CreateOboTokenRequest
- type CreateOboTokenResponse
- type CreateTokenRequest
- type CreateTokenResponse
- type DeleteAccountIpAccessListRequest
- type DeleteIpAccessListRequest
- type DeleteTokenManagementRequest
- type FetchIpAccessListResponse
- type GetAccountIpAccessListRequest
- type GetIpAccessListRequest
- type GetIpAccessListResponse
- type GetIpAccessListsResponse
- type GetStatusRequest
- type GetTokenManagementRequest
- type IpAccessListInfo
- type IpAccessListsAPI
- func (a *IpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
- func (a *IpAccessListsAPI) Delete(ctx context.Context, request DeleteIpAccessListRequest) error
- func (a *IpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error
- func (a *IpAccessListsAPI) Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error)
- func (a *IpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*FetchIpAccessListResponse, error)
- func (a *IpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)
- func (a *IpAccessListsAPI) Impl() IpAccessListsService
- func (a *IpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)
- func (a *IpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
- func (a *IpAccessListsAPI) Replace(ctx context.Context, request ReplaceIpAccessList) error
- func (a *IpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error
- func (a *IpAccessListsAPI) WithImpl(impl IpAccessListsService) *IpAccessListsAPI
- type IpAccessListsService
- type ListTokenManagementRequest
- type ListTokensResponse
- type ListType
- type PublicTokenInfo
- type ReplaceIpAccessList
- type RevokeTokenRequest
- 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) (*PublicTokenInfo, error)
- func (a *TokenManagementAPI) GetByTokenId(ctx context.Context, tokenId string) (*TokenInfo, error)
- func (a *TokenManagementAPI) Impl() TokenManagementService
- func (a *TokenManagementAPI) ListAll(ctx context.Context, request ListTokenManagementRequest) ([]PublicTokenInfo, error)
- func (a *TokenManagementAPI) PublicTokenInfoCommentToTokenIdMap(ctx context.Context, request ListTokenManagementRequest) (map[string]string, error)
- func (a *TokenManagementAPI) WithImpl(impl TokenManagementService) *TokenManagementAPI
- type TokenManagementService
- 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) (*PublicTokenInfo, error)
- func (a *TokensAPI) Impl() TokensService
- func (a *TokensAPI) ListAll(ctx context.Context) ([]PublicTokenInfo, error)
- func (a *TokensAPI) PublicTokenInfoCommentToTokenIdMap(ctx context.Context) (map[string]string, error)
- func (a *TokensAPI) WithImpl(impl TokensService) *TokensAPI
- type TokensService
- type UpdateIpAccessList
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountIpAccessListsAPI ¶
type AccountIpAccessListsAPI struct {
// contains filtered or unexported fields
}
The Accounts IP Access List API enables account admins to configure IP access lists for access to the account console.
Account IP Access Lists affect web application access and REST API access to the account console and account APIs. If the feature is disabled for the account, all access is allowed for this account. There is support for allow lists (inclusion) and block lists (exclusion).
When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.
If there is at least one allow list for the account, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the account, all IP addresses are allowed.
For all allow lists and block lists combined, the account supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
After changes to the account-level IP access lists, it can take a few minutes for changes to take effect.
func NewAccountIpAccessLists ¶
func NewAccountIpAccessLists(client *client.DatabricksClient) *AccountIpAccessListsAPI
func (*AccountIpAccessListsAPI) Create ¶
func (a *AccountIpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
Create access list.
Creates an IP access list for the account.
A list can be an allow list or a block list. See the top of this file for a description of how the server treats allow lists and block lists at runtime.
When creating or updating an IP access list:
* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the new list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.
It can take a few minutes for the changes to take effect.
func (*AccountIpAccessListsAPI) Delete ¶
func (a *AccountIpAccessListsAPI) Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error
Delete access list.
Deletes an IP access list, specified by its list ID.
func (*AccountIpAccessListsAPI) DeleteByIpAccessListId ¶
func (a *AccountIpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error
Delete access list.
Deletes an IP access list, specified by its list ID.
func (*AccountIpAccessListsAPI) Get ¶
func (a *AccountIpAccessListsAPI) Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error)
Get IP access list.
Gets an IP access list, specified by its list ID.
func (*AccountIpAccessListsAPI) GetByIpAccessListId ¶
func (a *AccountIpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*GetIpAccessListResponse, error)
Get IP access list.
Gets an IP access list, specified by its list ID.
func (*AccountIpAccessListsAPI) GetByLabel ¶
func (a *AccountIpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)
GetByLabel calls AccountIpAccessListsAPI.IpAccessListInfoLabelToListIdMap and returns a single IpAccessListInfo.
Returns an error if there's more than one IpAccessListInfo with the same .Label.
Note: All IpAccessListInfo instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*AccountIpAccessListsAPI) Impl ¶
func (a *AccountIpAccessListsAPI) Impl() AccountIpAccessListsService
Impl returns low-level AccountIpAccessLists API implementation
func (*AccountIpAccessListsAPI) IpAccessListInfoLabelToListIdMap ¶
func (a *AccountIpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)
IpAccessListInfoLabelToListIdMap calls AccountIpAccessListsAPI.ListAll and creates a map of results with IpAccessListInfo.Label as key and IpAccessListInfo.ListId as value.
Returns an error if there's more than one IpAccessListInfo with the same .Label.
Note: All IpAccessListInfo instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*AccountIpAccessListsAPI) ListAll ¶
func (a *AccountIpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
Get access lists.
Gets all IP access lists for the specified account.
This method is generated by Databricks SDK Code Generator.
func (*AccountIpAccessListsAPI) Replace ¶
func (a *AccountIpAccessListsAPI) Replace(ctx context.Context, request ReplaceIpAccessList) error
Replace access list.
Replaces an IP access list, specified by its ID.
A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time. When replacing an IP access list: * For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the resulting list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`. It can take a few minutes for the changes to take effect.
func (*AccountIpAccessListsAPI) Update ¶
func (a *AccountIpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error
Update access list.
Updates an existing IP access list, specified by its ID.
A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time.
When updating an IP access list:
* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the updated list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.
It can take a few minutes for the changes to take effect.
func (*AccountIpAccessListsAPI) WithImpl ¶
func (a *AccountIpAccessListsAPI) WithImpl(impl AccountIpAccessListsService) *AccountIpAccessListsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type AccountIpAccessListsService ¶
type AccountIpAccessListsService interface { // Create access list. // // Creates an IP access list for the account. // // A list can be an allow list or a block list. See the top of this file for // a description of how the server treats allow lists and block lists at // runtime. // // When creating or updating an IP access list: // // * For all allow lists and block lists combined, the API supports a // maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. // Attempts to exceed that number return error 400 with `error_code` value // `QUOTA_EXCEEDED`. * If the new list would block the calling user's // current IP, error 400 is returned with `error_code` value // `INVALID_STATE`. // // It can take a few minutes for the changes to take effect. Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error) // Delete access list. // // Deletes an IP access list, specified by its list ID. Delete(ctx context.Context, request DeleteAccountIpAccessListRequest) error // Get IP access list. // // Gets an IP access list, specified by its list ID. Get(ctx context.Context, request GetAccountIpAccessListRequest) (*GetIpAccessListResponse, error) // Get access lists. // // Gets all IP access lists for the specified account. // // Use ListAll() to get all IpAccessListInfo instances List(ctx context.Context) (*GetIpAccessListsResponse, error) // Replace access list. // // Replaces an IP access list, specified by its ID. // // A list can include allow lists and block lists. See the top of this file // for a description of how the server treats allow lists and block lists at // run time. When replacing an IP access list: * For all allow lists and // block lists combined, the API supports a maximum of 1000 IP/CIDR values, // where one CIDR counts as a single value. Attempts to exceed that number // return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the // resulting list would block the calling user's current IP, error 400 is // returned with `error_code` value `INVALID_STATE`. It can take a few // minutes for the changes to take effect. Replace(ctx context.Context, request ReplaceIpAccessList) error // Update access list. // // Updates an existing IP access list, specified by its ID. // // A list can include allow lists and block lists. See the top of this file // for a description of how the server treats allow lists and block lists at // run time. // // When updating an IP access list: // // * For all allow lists and block lists combined, the API supports a // maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. // Attempts to exceed that number return error 400 with `error_code` value // `QUOTA_EXCEEDED`. * If the updated list would block the calling user's // current IP, error 400 is returned with `error_code` value // `INVALID_STATE`. // // It can take a few minutes for the changes to take effect. Update(ctx context.Context, request UpdateIpAccessList) error }
The Accounts IP Access List API enables account admins to configure IP access lists for access to the account console.
Account IP Access Lists affect web application access and REST API access to the account console and account APIs. If the feature is disabled for the account, all access is allowed for this account. There is support for allow lists (inclusion) and block lists (exclusion).
When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.
If there is at least one allow list for the account, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the account, all IP addresses are allowed.
For all allow lists and block lists combined, the account supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
After changes to the account-level IP access lists, it can take a few minutes for changes to take effect.
type 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"` // This describes an enum ListType ListType `json:"list_type"` }
type CreateIpAccessListResponse ¶
type CreateIpAccessListResponse struct {
IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}
type CreateOboTokenRequest ¶
type CreateOboTokenRequest struct { // Application ID of the service principal. ApplicationId string `json:"application_id"` // Comment that describes the purpose of the token. Comment string `json:"comment,omitempty"` // The number of seconds before the token expires. LifetimeSeconds int64 `json:"lifetime_seconds"` }
type CreateOboTokenResponse ¶
type CreateTokenRequest ¶
type CreateTokenRequest struct { // Optional description to attach to the token. Comment string `json:"comment,omitempty"` // The lifetime of the token, in seconds. // // If the ifetime is not specified, this token remains valid indefinitely. LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"` }
type CreateTokenResponse ¶
type CreateTokenResponse struct { // The information for the new token. TokenInfo *PublicTokenInfo `json:"token_info,omitempty"` // The value of the new token. TokenValue string `json:"token_value,omitempty"` }
type DeleteAccountIpAccessListRequest ¶
type DeleteAccountIpAccessListRequest struct { // The ID for the corresponding IP access list. IpAccessListId string `json:"-" url:"-"` }
Delete access list
type DeleteIpAccessListRequest ¶
type DeleteIpAccessListRequest struct { // The ID for the corresponding IP access list to modify. IpAccessListId string `json:"-" url:"-"` }
Delete access list
type DeleteTokenManagementRequest ¶
type DeleteTokenManagementRequest struct { // The ID of the token to get. TokenId string `json:"-" url:"-"` }
Delete a token
type FetchIpAccessListResponse ¶
type FetchIpAccessListResponse struct {
IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}
type GetAccountIpAccessListRequest ¶
type GetAccountIpAccessListRequest struct { // The ID for the corresponding IP access list. IpAccessListId string `json:"-" url:"-"` }
Get IP access list
type GetIpAccessListRequest ¶
type GetIpAccessListRequest struct { // The ID for the corresponding IP access list to modify. IpAccessListId string `json:"-" url:"-"` }
Get access list
type GetIpAccessListResponse ¶
type GetIpAccessListResponse struct {
IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}
type GetIpAccessListsResponse ¶
type GetIpAccessListsResponse struct {
IpAccessLists []IpAccessListInfo `json:"ip_access_lists,omitempty"`
}
type GetStatusRequest ¶
type GetStatusRequest struct {
Keys string `json:"-" url:"keys"`
}
Check configuration status
type GetTokenManagementRequest ¶
type GetTokenManagementRequest struct { // The ID of the token to get. TokenId string `json:"-" url:"-"` }
Get token info
type 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"` // This describes an enum ListType ListType `json:"list_type,omitempty"` // Update timestamp in milliseconds. UpdatedAt int64 `json:"updated_at,omitempty"` // User ID of the user who updated this list. UpdatedBy int64 `json:"updated_by,omitempty"` }
type IpAccessListsAPI ¶
type IpAccessListsAPI struct {
// contains filtered or unexported fields
}
IP Access List enables admins to configure IP access lists.
IP access lists affect web application access and REST API access to this workspace only. If the feature is disabled for a workspace, all access is allowed for this workspace. There is support for allow lists (inclusion) and block lists (exclusion).
When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.
If there is at least one allow list for the workspace, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the workspace, all IP addresses are allowed.
For all allow lists and block lists combined, the workspace supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
After changes to the IP access list feature, it can take a few minutes for changes to take effect.
func NewIpAccessLists ¶
func NewIpAccessLists(client *client.DatabricksClient) *IpAccessListsAPI
func (*IpAccessListsAPI) Create ¶
func (a *IpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
Create access list.
Creates an IP access list for this workspace.
A list can be an allow list or a block list. See the top of this file for a description of how the server treats allow lists and block lists at runtime.
When creating or updating an IP access list:
* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the new list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.
It can take a few minutes for the changes to take effect. **Note**: Your new IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus
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.
func (*IpAccessListsAPI) GetByIpAccessListId ¶
func (a *IpAccessListsAPI) GetByIpAccessListId(ctx context.Context, ipAccessListId string) (*FetchIpAccessListResponse, error)
Get access list.
Gets an IP access list, specified by its list ID.
func (*IpAccessListsAPI) GetByLabel ¶
func (a *IpAccessListsAPI) GetByLabel(ctx context.Context, name string) (*IpAccessListInfo, error)
GetByLabel calls IpAccessListsAPI.IpAccessListInfoLabelToListIdMap and returns a single IpAccessListInfo.
Returns an error if there's more than one IpAccessListInfo with the same .Label.
Note: All IpAccessListInfo instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*IpAccessListsAPI) Impl ¶
func (a *IpAccessListsAPI) Impl() IpAccessListsService
Impl returns low-level IpAccessLists API implementation
func (*IpAccessListsAPI) IpAccessListInfoLabelToListIdMap ¶
func (a *IpAccessListsAPI) IpAccessListInfoLabelToListIdMap(ctx context.Context) (map[string]string, error)
IpAccessListInfoLabelToListIdMap calls IpAccessListsAPI.ListAll and creates a map of results with IpAccessListInfo.Label as key and IpAccessListInfo.ListId as value.
Returns an error if there's more than one IpAccessListInfo with the same .Label.
Note: All IpAccessListInfo instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*IpAccessListsAPI) ListAll ¶
func (a *IpAccessListsAPI) ListAll(ctx context.Context) ([]IpAccessListInfo, error)
Get access lists.
Gets all IP access lists for the specified workspace.
This method is generated by Databricks SDK Code Generator.
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.
func (*IpAccessListsAPI) Update ¶
func (a *IpAccessListsAPI) Update(ctx context.Context, request UpdateIpAccessList) error
Update access list.
Updates an existing IP access list, specified by its ID.
A list can include allow lists and block lists. See the top of this file for a description of how the server treats allow lists and block lists at run time.
When updating an IP access list:
* For all allow lists and block lists combined, the API supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. Attempts to exceed that number return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the updated list would block the calling user's current IP, error 400 is returned with `error_code` value `INVALID_STATE`.
It can take a few minutes for the changes to take effect. Note that your resulting IP access list has no effect until you enable the feature. See :method:workspaceconf/setStatus.
func (*IpAccessListsAPI) WithImpl ¶
func (a *IpAccessListsAPI) WithImpl(impl IpAccessListsService) *IpAccessListsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type IpAccessListsService ¶
type IpAccessListsService interface { // Create access list. // // Creates an IP access list for this workspace. // // A list can be an allow list or a block list. See the top of this file for // a description of how the server treats allow lists and block lists at // runtime. // // When creating or updating an IP access list: // // * For all allow lists and block lists combined, the API supports a // maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. // Attempts to exceed that number return error 400 with `error_code` value // `QUOTA_EXCEEDED`. * If the new list would block the calling user's // current IP, error 400 is returned with `error_code` value // `INVALID_STATE`. // // It can take a few minutes for the changes to take effect. **Note**: Your // new IP access list has no effect until you enable the feature. See // :method:workspaceconf/setStatus Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error) // Delete access list. // // Deletes an IP access list, specified by its list ID. Delete(ctx context.Context, request DeleteIpAccessListRequest) error // Get access list. // // Gets an IP access list, specified by its list ID. Get(ctx context.Context, request GetIpAccessListRequest) (*FetchIpAccessListResponse, error) // Get access lists. // // Gets all IP access lists for the specified workspace. // // Use ListAll() to get all IpAccessListInfo instances List(ctx context.Context) (*GetIpAccessListResponse, error) // Replace access list. // // Replaces an IP access list, specified by its ID. // // A list can include allow lists and block lists. See the top of this file // for a description of how the server treats allow lists and block lists at // run time. When replacing an IP access list: * For all allow lists and // block lists combined, the API supports a maximum of 1000 IP/CIDR values, // where one CIDR counts as a single value. Attempts to exceed that number // return error 400 with `error_code` value `QUOTA_EXCEEDED`. * If the // resulting list would block the calling user's current IP, error 400 is // returned with `error_code` value `INVALID_STATE`. It can take a few // minutes for the changes to take effect. Note that your resulting IP // access list has no effect until you enable the feature. See // :method:workspaceconf/setStatus. Replace(ctx context.Context, request ReplaceIpAccessList) error // Update access list. // // Updates an existing IP access list, specified by its ID. // // A list can include allow lists and block lists. See the top of this file // for a description of how the server treats allow lists and block lists at // run time. // // When updating an IP access list: // // * For all allow lists and block lists combined, the API supports a // maximum of 1000 IP/CIDR values, where one CIDR counts as a single value. // Attempts to exceed that number return error 400 with `error_code` value // `QUOTA_EXCEEDED`. * If the updated list would block the calling user's // current IP, error 400 is returned with `error_code` value // `INVALID_STATE`. // // It can take a few minutes for the changes to take effect. Note that your // resulting IP access list has no effect until you enable the feature. See // :method:workspaceconf/setStatus. Update(ctx context.Context, request UpdateIpAccessList) error }
IP Access List enables admins to configure IP access lists.
IP access lists affect web application access and REST API access to this workspace only. If the feature is disabled for a workspace, all access is allowed for this workspace. There is support for allow lists (inclusion) and block lists (exclusion).
When a connection is attempted: 1. **First, all block lists are checked.** If the connection IP address matches any block list, the connection is rejected. 2. **If the connection was not rejected by block lists**, the IP address is compared with the allow lists.
If there is at least one allow list for the workspace, the connection is allowed only if the IP address matches an allow list. If there are no allow lists for the workspace, all IP addresses are allowed.
For all allow lists and block lists combined, the workspace supports a maximum of 1000 IP/CIDR values, where one CIDR counts as a single value.
After changes to the IP access list feature, it can take a few minutes for changes to take effect.
type ListTokenManagementRequest ¶
type ListTokenManagementRequest struct { // User ID of the user that created the token. CreatedById string `json:"-" url:"created_by_id,omitempty"` // Username of the user that created the token. CreatedByUsername string `json:"-" url:"created_by_username,omitempty"` }
List all tokens
type ListTokensResponse ¶
type ListTokensResponse struct { // The information for each token. TokenInfos []PublicTokenInfo `json:"token_infos,omitempty"` }
type ListType ¶
type ListType string
This describes an enum
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 PublicTokenInfo ¶
type PublicTokenInfo struct { // Comment the token was created with, if applicable. Comment string `json:"comment,omitempty"` // Server time (in epoch milliseconds) when the token was created. CreationTime int64 `json:"creation_time,omitempty"` // Server time (in epoch milliseconds) when the token will expire, or -1 if // not applicable. ExpiryTime int64 `json:"expiry_time,omitempty"` // The ID of this token. TokenId string `json:"token_id,omitempty"` }
type ReplaceIpAccessList ¶
type ReplaceIpAccessList struct { // Specifies whether this IP access list is enabled. Enabled bool `json:"enabled"` // The ID for the corresponding IP access list. IpAccessListId string `json:"-" url:"-"` // 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"` // This describes an enum ListType ListType `json:"list_type"` }
type RevokeTokenRequest ¶
type RevokeTokenRequest struct { // The ID of the token to be revoked. TokenId string `json:"token_id"` }
type TokenInfo ¶
type TokenInfo struct { // Comment that describes the purpose of the token, specified by the token // creator. Comment string `json:"comment,omitempty"` // User ID of the user that created the token. CreatedById int64 `json:"created_by_id,omitempty"` // Username of the user that created the token. CreatedByUsername string `json:"created_by_username,omitempty"` // Timestamp when the token was created. CreationTime int64 `json:"creation_time,omitempty"` // Timestamp when the token expires. ExpiryTime int64 `json:"expiry_time,omitempty"` // User ID of the user that owns the token. OwnerId int64 `json:"owner_id,omitempty"` // ID of the token. TokenId string `json:"token_id,omitempty"` }
type TokenManagementAPI ¶
type TokenManagementAPI struct {
// contains filtered or unexported fields
}
Enables administrators to get all tokens and delete tokens for other users. Admins can either get every token, get a specific token by ID, or get all tokens for a particular user.
func NewTokenManagement ¶
func NewTokenManagement(client *client.DatabricksClient) *TokenManagementAPI
func (*TokenManagementAPI) CreateOboToken ¶
func (a *TokenManagementAPI) CreateOboToken(ctx context.Context, request CreateOboTokenRequest) (*CreateOboTokenResponse, error)
Create on-behalf token.
Creates a token on behalf of a service principal.
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.
func (*TokenManagementAPI) GetByComment ¶
func (a *TokenManagementAPI) GetByComment(ctx context.Context, name string) (*PublicTokenInfo, error)
GetByComment calls TokenManagementAPI.PublicTokenInfoCommentToTokenIdMap and returns a single PublicTokenInfo.
Returns an error if there's more than one PublicTokenInfo with the same .Comment.
Note: All PublicTokenInfo instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*TokenManagementAPI) GetByTokenId ¶
Get token info.
Gets information about a token, specified by its ID.
func (*TokenManagementAPI) Impl ¶
func (a *TokenManagementAPI) Impl() TokenManagementService
Impl returns low-level TokenManagement API implementation
func (*TokenManagementAPI) ListAll ¶
func (a *TokenManagementAPI) ListAll(ctx context.Context, request ListTokenManagementRequest) ([]PublicTokenInfo, error)
List all tokens.
Lists all tokens associated with the specified workspace or user.
This method is generated by Databricks SDK Code Generator.
func (*TokenManagementAPI) PublicTokenInfoCommentToTokenIdMap ¶
func (a *TokenManagementAPI) PublicTokenInfoCommentToTokenIdMap(ctx context.Context, request ListTokenManagementRequest) (map[string]string, error)
PublicTokenInfoCommentToTokenIdMap calls TokenManagementAPI.ListAll and creates a map of results with PublicTokenInfo.Comment as key and PublicTokenInfo.TokenId as value.
Returns an error if there's more than one PublicTokenInfo with the same .Comment.
Note: All PublicTokenInfo instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*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) // List all tokens. // // Lists all tokens associated with the specified workspace or user. // // Use ListAll() to get all PublicTokenInfo instances List(ctx context.Context, request ListTokenManagementRequest) (*ListTokensResponse, 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 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**.
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.PublicTokenInfoCommentToTokenIdMap and returns a single PublicTokenInfo.
Returns an error if there's more than one PublicTokenInfo with the same .Comment.
Note: All PublicTokenInfo instances are loaded into memory before returning matching by name.
This method is generated by Databricks SDK Code Generator.
func (*TokensAPI) Impl ¶
func (a *TokensAPI) Impl() TokensService
Impl returns low-level Tokens API implementation
func (*TokensAPI) ListAll ¶
func (a *TokensAPI) ListAll(ctx context.Context) ([]PublicTokenInfo, error)
List tokens.
Lists all the valid tokens for a user-workspace pair.
This method is generated by Databricks SDK Code Generator.
func (*TokensAPI) PublicTokenInfoCommentToTokenIdMap ¶
func (a *TokensAPI) PublicTokenInfoCommentToTokenIdMap(ctx context.Context) (map[string]string, error)
PublicTokenInfoCommentToTokenIdMap calls TokensAPI.ListAll and creates a map of results with PublicTokenInfo.Comment as key and PublicTokenInfo.TokenId as value.
Returns an error if there's more than one PublicTokenInfo with the same .Comment.
Note: All PublicTokenInfo instances are loaded into memory before creating a map.
This method is generated by Databricks SDK Code Generator.
func (*TokensAPI) WithImpl ¶
func (a *TokensAPI) WithImpl(impl TokensService) *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 PublicTokenInfo 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 UpdateIpAccessList ¶
type UpdateIpAccessList struct { // Specifies whether this IP access list is enabled. Enabled bool `json:"enabled"` // The ID for the corresponding IP access list. IpAccessListId string `json:"-" url:"-"` // 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"` // This describes an enum ListType ListType `json:"list_type"` }
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.
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.