Documentation ¶
Overview ¶
IP Access List enables admins to configure IP access lists.
Index ¶
- type CreateIpAccessList
- type CreateIpAccessListResponse
- type Delete
- type FetchIpAccessListResponse
- type Get
- type GetIpAccessListResponse
- type IpAccessListInfo
- type IpAccessListsAPI
- func (a *IpAccessListsAPI) Create(ctx context.Context, request CreateIpAccessList) (*CreateIpAccessListResponse, error)
- func (a *IpAccessListsAPI) Delete(ctx context.Context, request Delete) error
- func (a *IpAccessListsAPI) DeleteByIpAccessListId(ctx context.Context, ipAccessListId string) error
- func (a *IpAccessListsAPI) Get(ctx context.Context, request Get) (*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 ListType
- type ReplaceIpAccessList
- type UpdateIpAccessList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 Delete ¶
type Delete struct { // The ID for the corresponding IP access list to modify. IpAccessListId string `json:"-" url:"-"` }
Delete access list
type FetchIpAccessListResponse ¶
type FetchIpAccessListResponse struct {
IpAccessList *IpAccessListInfo `json:"ip_access_list,omitempty"`
}
type Get ¶
type Get 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 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 Delete) 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 Get) (*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 Delete) error // Get access list. // // Gets an IP access list, specified by its list ID. Get(ctx context.Context, request Get) (*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 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 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"` // This describes an enum ListType ListType `json:"list_type"` }
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"` // This describes an enum ListType ListType `json:"list_type"` }