scim

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

These APIs allow you to manage Account Groups, Account Service Principals, Account Users, Current User, Groups, Service Principals, Users, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountGroupsAPI

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

Groups simplify identity management, making it easier to assign access to Databricks Account, data, and other securable objects.

It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, instead of to users individually. All Databricks Account identities can be assigned as members of groups, and members inherit permissions that are assigned to their group.

func NewAccountGroups

func NewAccountGroups(client *client.DatabricksClient) *AccountGroupsAPI

func (*AccountGroupsAPI) Create

func (a *AccountGroupsAPI) Create(ctx context.Context, request Group) (*Group, error)

Create a new group.

Creates a group in the Databricks Account with a unique name, using the supplied group details.

func (*AccountGroupsAPI) Delete

func (a *AccountGroupsAPI) Delete(ctx context.Context, request DeleteGroupRequest) error

Delete a group.

Deletes a group from the Databricks Account.

func (*AccountGroupsAPI) DeleteById

func (a *AccountGroupsAPI) DeleteById(ctx context.Context, id string) error

Delete a group.

Deletes a group from the Databricks Account.

func (*AccountGroupsAPI) Get

func (a *AccountGroupsAPI) Get(ctx context.Context, request GetGroupRequest) (*Group, error)

Get group details.

Gets the information for a specific group in the Databricks Account.

func (*AccountGroupsAPI) GetByDisplayName

func (a *AccountGroupsAPI) GetByDisplayName(ctx context.Context, name string) (*Group, error)

GetByDisplayName calls AccountGroupsAPI.GroupDisplayNameToIdMap and returns a single Group.

Returns an error if there's more than one Group with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*AccountGroupsAPI) GetById

func (a *AccountGroupsAPI) GetById(ctx context.Context, id string) (*Group, error)

Get group details.

Gets the information for a specific group in the Databricks Account.

func (*AccountGroupsAPI) GroupDisplayNameToIdMap

func (a *AccountGroupsAPI) GroupDisplayNameToIdMap(ctx context.Context, request ListGroupsRequest) (map[string]string, error)

GroupDisplayNameToIdMap calls AccountGroupsAPI.ListAll and creates a map of results with Group.DisplayName as key and Group.Id as value.

Returns an error if there's more than one Group with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*AccountGroupsAPI) Impl

Impl returns low-level AccountGroups API implementation

func (*AccountGroupsAPI) ListAll

func (a *AccountGroupsAPI) ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)

List group details.

Gets all details of the groups associated with the Databricks Account.

This method is generated by Databricks SDK Code Generator.

func (*AccountGroupsAPI) Patch

func (a *AccountGroupsAPI) Patch(ctx context.Context, request PartialUpdate) error

Update group details.

Partially updates the details of a group.

func (*AccountGroupsAPI) Update

func (a *AccountGroupsAPI) Update(ctx context.Context, request Group) error

Replace a group.

Updates the details of a group by replacing the entire group entity.

func (*AccountGroupsAPI) WithImpl

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

type AccountGroupsService

type AccountGroupsService interface {

	// Create a new group.
	//
	// Creates a group in the Databricks Account with a unique name, using the
	// supplied group details.
	Create(ctx context.Context, request Group) (*Group, error)

	// Delete a group.
	//
	// Deletes a group from the Databricks Account.
	Delete(ctx context.Context, request DeleteGroupRequest) error

	// Get group details.
	//
	// Gets the information for a specific group in the Databricks Account.
	Get(ctx context.Context, request GetGroupRequest) (*Group, error)

	// List group details.
	//
	// Gets all details of the groups associated with the Databricks Account.
	//
	// Use ListAll() to get all Group instances
	List(ctx context.Context, request ListGroupsRequest) (*ListGroupsResponse, error)

	// Update group details.
	//
	// Partially updates the details of a group.
	Patch(ctx context.Context, request PartialUpdate) error

	// Replace a group.
	//
	// Updates the details of a group by replacing the entire group entity.
	Update(ctx context.Context, request Group) error
}

Groups simplify identity management, making it easier to assign access to Databricks Account, data, and other securable objects.

It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, instead of to users individually. All Databricks Account identities can be assigned as members of groups, and members inherit permissions that are assigned to their group.

type AccountServicePrincipalsAPI

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

Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. Databricks recommends creating service principals to run production jobs or modify production data. If all processes that act on production data run with service principals, interactive users do not need any write, delete, or modify privileges in production. This eliminates the risk of a user overwriting production data by accident.

func NewAccountServicePrincipals

func NewAccountServicePrincipals(client *client.DatabricksClient) *AccountServicePrincipalsAPI

func (*AccountServicePrincipalsAPI) Create

Create a service principal.

Creates a new service principal in the Databricks Account.

func (*AccountServicePrincipalsAPI) Delete

Delete a service principal.

Delete a single service principal in the Databricks Account.

func (*AccountServicePrincipalsAPI) DeleteById

func (a *AccountServicePrincipalsAPI) DeleteById(ctx context.Context, id string) error

Delete a service principal.

Delete a single service principal in the Databricks Account.

func (*AccountServicePrincipalsAPI) Get

Get service principal details.

Gets the details for a single service principal define in the Databricks Account.

func (*AccountServicePrincipalsAPI) GetByDisplayName

func (a *AccountServicePrincipalsAPI) GetByDisplayName(ctx context.Context, name string) (*ServicePrincipal, error)

GetByDisplayName calls AccountServicePrincipalsAPI.ServicePrincipalDisplayNameToIdMap and returns a single ServicePrincipal.

Returns an error if there's more than one ServicePrincipal with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*AccountServicePrincipalsAPI) GetById

Get service principal details.

Gets the details for a single service principal define in the Databricks Account.

func (*AccountServicePrincipalsAPI) Impl

Impl returns low-level AccountServicePrincipals API implementation

func (*AccountServicePrincipalsAPI) ListAll

List service principals.

Gets the set of service principals associated with a Databricks Account.

This method is generated by Databricks SDK Code Generator.

func (*AccountServicePrincipalsAPI) Patch

Update service principal details.

Partially updates the details of a single service principal in the Databricks Account.

func (*AccountServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap

func (a *AccountServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListServicePrincipalsRequest) (map[string]string, error)

ServicePrincipalDisplayNameToIdMap calls AccountServicePrincipalsAPI.ListAll and creates a map of results with ServicePrincipal.DisplayName as key and ServicePrincipal.Id as value.

Returns an error if there's more than one ServicePrincipal with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*AccountServicePrincipalsAPI) Update

Replace service principal.

Updates the details of a single service principal.

This action replaces the existing service principal with the same name.

func (*AccountServicePrincipalsAPI) WithImpl

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

type AccountServicePrincipalsService

type AccountServicePrincipalsService interface {

	// Create a service principal.
	//
	// Creates a new service principal in the Databricks Account.
	Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)

	// Delete a service principal.
	//
	// Delete a single service principal in the Databricks Account.
	Delete(ctx context.Context, request DeleteServicePrincipalRequest) error

	// Get service principal details.
	//
	// Gets the details for a single service principal define in the Databricks
	// Account.
	Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)

	// List service principals.
	//
	// Gets the set of service principals associated with a Databricks Account.
	//
	// Use ListAll() to get all ServicePrincipal instances
	List(ctx context.Context, request ListServicePrincipalsRequest) (*ListServicePrincipalResponse, error)

	// Update service principal details.
	//
	// Partially updates the details of a single service principal in the
	// Databricks Account.
	Patch(ctx context.Context, request PartialUpdate) error

	// Replace service principal.
	//
	// Updates the details of a single service principal.
	//
	// This action replaces the existing service principal with the same name.
	Update(ctx context.Context, request ServicePrincipal) error
}

Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. Databricks recommends creating service principals to run production jobs or modify production data. If all processes that act on production data run with service principals, interactive users do not need any write, delete, or modify privileges in production. This eliminates the risk of a user overwriting production data by accident.

type AccountUsersAPI

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

User identities recognized by Databricks and represented by email addresses.

Databricks recommends using SCIM provisioning to sync users and groups automatically from your identity provider to your Databricks Account. SCIM streamlines onboarding a new employee or team by using your identity provider to create users and groups in Databricks Account and give them the proper level of access. When a user leaves your organization or no longer needs access to Databricks Account, admins can terminate the user in your identity provider and that user’s account will also be removed from Databricks Account. This ensures a consistent offboarding process and prevents unauthorized users from accessing sensitive data.

func NewAccountUsers

func NewAccountUsers(client *client.DatabricksClient) *AccountUsersAPI

func (*AccountUsersAPI) Create

func (a *AccountUsersAPI) Create(ctx context.Context, request User) (*User, error)

Create a new user.

Creates a new user in the Databricks Account. This new user will also be added to the Databricks account.

func (*AccountUsersAPI) Delete

func (a *AccountUsersAPI) Delete(ctx context.Context, request DeleteUserRequest) error

Delete a user.

Deletes a user. Deleting a user from a Databricks Account also removes objects associated with the user.

func (*AccountUsersAPI) DeleteById

func (a *AccountUsersAPI) DeleteById(ctx context.Context, id string) error

Delete a user.

Deletes a user. Deleting a user from a Databricks Account also removes objects associated with the user.

func (*AccountUsersAPI) Get

func (a *AccountUsersAPI) Get(ctx context.Context, request GetUserRequest) (*User, error)

Get user details.

Gets information for a specific user in Databricks Account.

func (*AccountUsersAPI) GetById

func (a *AccountUsersAPI) GetById(ctx context.Context, id string) (*User, error)

Get user details.

Gets information for a specific user in Databricks Account.

func (*AccountUsersAPI) GetByUserName

func (a *AccountUsersAPI) GetByUserName(ctx context.Context, name string) (*User, error)

GetByUserName calls AccountUsersAPI.UserUserNameToIdMap and returns a single User.

Returns an error if there's more than one User with the same .UserName.

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

This method is generated by Databricks SDK Code Generator.

func (*AccountUsersAPI) Impl

Impl returns low-level AccountUsers API implementation

func (*AccountUsersAPI) ListAll

func (a *AccountUsersAPI) ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)

List users.

Gets details for all the users associated with a Databricks Account.

This method is generated by Databricks SDK Code Generator.

func (*AccountUsersAPI) Patch

func (a *AccountUsersAPI) Patch(ctx context.Context, request PartialUpdate) error

Update user details.

Partially updates a user resource by applying the supplied operations on specific user attributes.

func (*AccountUsersAPI) Update

func (a *AccountUsersAPI) Update(ctx context.Context, request User) error

Replace a user.

Replaces a user's information with the data supplied in request.

func (*AccountUsersAPI) UserUserNameToIdMap

func (a *AccountUsersAPI) UserUserNameToIdMap(ctx context.Context, request ListUsersRequest) (map[string]string, error)

UserUserNameToIdMap calls AccountUsersAPI.ListAll and creates a map of results with User.UserName as key and User.Id as value.

Returns an error if there's more than one User with the same .UserName.

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

This method is generated by Databricks SDK Code Generator.

func (*AccountUsersAPI) WithImpl

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

type AccountUsersService

type AccountUsersService interface {

	// Create a new user.
	//
	// Creates a new user in the Databricks Account. This new user will also be
	// added to the Databricks account.
	Create(ctx context.Context, request User) (*User, error)

	// Delete a user.
	//
	// Deletes a user. Deleting a user from a Databricks Account also removes
	// objects associated with the user.
	Delete(ctx context.Context, request DeleteUserRequest) error

	// Get user details.
	//
	// Gets information for a specific user in Databricks Account.
	Get(ctx context.Context, request GetUserRequest) (*User, error)

	// List users.
	//
	// Gets details for all the users associated with a Databricks Account.
	//
	// Use ListAll() to get all User instances
	List(ctx context.Context, request ListUsersRequest) (*ListUsersResponse, error)

	// Update user details.
	//
	// Partially updates a user resource by applying the supplied operations on
	// specific user attributes.
	Patch(ctx context.Context, request PartialUpdate) error

	// Replace a user.
	//
	// Replaces a user's information with the data supplied in request.
	Update(ctx context.Context, request User) error
}

User identities recognized by Databricks and represented by email addresses.

Databricks recommends using SCIM provisioning to sync users and groups automatically from your identity provider to your Databricks Account. SCIM streamlines onboarding a new employee or team by using your identity provider to create users and groups in Databricks Account and give them the proper level of access. When a user leaves your organization or no longer needs access to Databricks Account, admins can terminate the user in your identity provider and that user’s account will also be removed from Databricks Account. This ensures a consistent offboarding process and prevents unauthorized users from accessing sensitive data.

type ComplexValue

type ComplexValue struct {
	Display string `json:"display,omitempty"`

	Primary bool `json:"primary,omitempty"`

	Ref string `json:"$ref,omitempty"`

	Type string `json:"type,omitempty"`

	Value string `json:"value,omitempty"`
}

type CurrentUserAPI

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

This API allows retrieving information about currently authenticated user or service principal.

func NewCurrentUser

func NewCurrentUser(client *client.DatabricksClient) *CurrentUserAPI

func (*CurrentUserAPI) Impl

Impl returns low-level CurrentUser API implementation

func (*CurrentUserAPI) Me

func (a *CurrentUserAPI) Me(ctx context.Context) (*User, error)

Get current user info.

Get details about the current method caller's identity.

func (*CurrentUserAPI) WithImpl

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

type CurrentUserService

type CurrentUserService interface {

	// Get current user info.
	//
	// Get details about the current method caller's identity.
	Me(ctx context.Context) (*User, error)
}

This API allows retrieving information about currently authenticated user or service principal.

type DeleteGroupRequest

type DeleteGroupRequest struct {
	// Unique ID for a group in the Databricks Account.
	Id string `json:"-" url:"-"`
}

Delete a group

type DeleteServicePrincipalRequest

type DeleteServicePrincipalRequest struct {
	// Unique ID for a service principal in the Databricks Account.
	Id string `json:"-" url:"-"`
}

Delete a service principal

type DeleteUserRequest

type DeleteUserRequest struct {
	// Unique ID for a user in the Databricks Account.
	Id string `json:"-" url:"-"`
}

Delete a user

type GetGroupRequest

type GetGroupRequest struct {
	// Unique ID for a group in the Databricks Account.
	Id string `json:"-" url:"-"`
}

Get group details

type GetServicePrincipalRequest

type GetServicePrincipalRequest struct {
	// Unique ID for a service principal in the Databricks Account.
	Id string `json:"-" url:"-"`
}

Get service principal details

type GetUserRequest

type GetUserRequest struct {
	// Unique ID for a user in the Databricks Account.
	Id string `json:"-" url:"-"`
}

Get user details

type Group

type Group struct {
	// String that represents a human-readable group name
	DisplayName string `json:"displayName,omitempty"`

	Entitlements []ComplexValue `json:"entitlements,omitempty"`

	ExternalId string `json:"externalId,omitempty"`

	Groups []ComplexValue `json:"groups,omitempty"`
	// Databricks group ID
	Id string `json:"id,omitempty" url:"-"`

	Members []ComplexValue `json:"members,omitempty"`

	Roles []ComplexValue `json:"roles,omitempty"`
}

type GroupsAPI

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

Groups simplify identity management, making it easier to assign access to Databricks Workspace, data, and other securable objects.

It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, instead of to users individually. All Databricks Workspace identities can be assigned as members of groups, and members inherit permissions that are assigned to their group.

func NewGroups

func NewGroups(client *client.DatabricksClient) *GroupsAPI

func (*GroupsAPI) Create

func (a *GroupsAPI) Create(ctx context.Context, request Group) (*Group, error)

Create a new group.

Creates a group in the Databricks Workspace with a unique name, using the supplied group details.

func (*GroupsAPI) Delete

func (a *GroupsAPI) Delete(ctx context.Context, request DeleteGroupRequest) error

Delete a group.

Deletes a group from the Databricks Workspace.

func (*GroupsAPI) DeleteById

func (a *GroupsAPI) DeleteById(ctx context.Context, id string) error

Delete a group.

Deletes a group from the Databricks Workspace.

func (*GroupsAPI) Get

func (a *GroupsAPI) Get(ctx context.Context, request GetGroupRequest) (*Group, error)

Get group details.

Gets the information for a specific group in the Databricks Workspace.

func (*GroupsAPI) GetByDisplayName

func (a *GroupsAPI) GetByDisplayName(ctx context.Context, name string) (*Group, error)

GetByDisplayName calls GroupsAPI.GroupDisplayNameToIdMap and returns a single Group.

Returns an error if there's more than one Group with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*GroupsAPI) GetById

func (a *GroupsAPI) GetById(ctx context.Context, id string) (*Group, error)

Get group details.

Gets the information for a specific group in the Databricks Workspace.

func (*GroupsAPI) GroupDisplayNameToIdMap

func (a *GroupsAPI) GroupDisplayNameToIdMap(ctx context.Context, request ListGroupsRequest) (map[string]string, error)

GroupDisplayNameToIdMap calls GroupsAPI.ListAll and creates a map of results with Group.DisplayName as key and Group.Id as value.

Returns an error if there's more than one Group with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*GroupsAPI) Impl

func (a *GroupsAPI) Impl() GroupsService

Impl returns low-level Groups API implementation

func (*GroupsAPI) ListAll

func (a *GroupsAPI) ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)

List group details.

Gets all details of the groups associated with the Databricks Workspace.

This method is generated by Databricks SDK Code Generator.

func (*GroupsAPI) Patch

func (a *GroupsAPI) Patch(ctx context.Context, request PartialUpdate) error

Update group details.

Partially updates the details of a group.

func (*GroupsAPI) Update

func (a *GroupsAPI) Update(ctx context.Context, request Group) error

Replace a group.

Updates the details of a group by replacing the entire group entity.

func (*GroupsAPI) WithImpl

func (a *GroupsAPI) WithImpl(impl GroupsService) *GroupsAPI

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

type GroupsService

type GroupsService interface {

	// Create a new group.
	//
	// Creates a group in the Databricks Workspace with a unique name, using the
	// supplied group details.
	Create(ctx context.Context, request Group) (*Group, error)

	// Delete a group.
	//
	// Deletes a group from the Databricks Workspace.
	Delete(ctx context.Context, request DeleteGroupRequest) error

	// Get group details.
	//
	// Gets the information for a specific group in the Databricks Workspace.
	Get(ctx context.Context, request GetGroupRequest) (*Group, error)

	// List group details.
	//
	// Gets all details of the groups associated with the Databricks Workspace.
	//
	// Use ListAll() to get all Group instances
	List(ctx context.Context, request ListGroupsRequest) (*ListGroupsResponse, error)

	// Update group details.
	//
	// Partially updates the details of a group.
	Patch(ctx context.Context, request PartialUpdate) error

	// Replace a group.
	//
	// Updates the details of a group by replacing the entire group entity.
	Update(ctx context.Context, request Group) error
}

Groups simplify identity management, making it easier to assign access to Databricks Workspace, data, and other securable objects.

It is best practice to assign access to workspaces and access-control policies in Unity Catalog to groups, instead of to users individually. All Databricks Workspace identities can be assigned as members of groups, and members inherit permissions that are assigned to their group.

type ListGroupsRequest

type ListGroupsRequest struct {
	// Comma-separated list of attributes to return in response.
	Attributes string `json:"-" url:"attributes,omitempty"`
	// Desired number of results per page.
	Count int `json:"-" url:"count,omitempty"`
	// Comma-separated list of attributes to exclude in response.
	ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"`
	// Query by which the results have to be filtered. Supported operators are
	// equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`).
	// Additionally, simple expressions can be formed using logical operators -
	// `and` and `or`. The [SCIM RFC] has more details but we currently only
	// support simple expressions.
	//
	// [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2
	Filter string `json:"-" url:"filter,omitempty"`
	// Attribute to sort the results.
	SortBy string `json:"-" url:"sortBy,omitempty"`
	// The order to sort the results.
	SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"`
	// Specifies the index of the first result. First item is number 1.
	StartIndex int `json:"-" url:"startIndex,omitempty"`
}

List group details

type ListGroupsResponse

type ListGroupsResponse struct {
	// Total results returned in the response.
	ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
	// User objects returned in the response.
	Resources []Group `json:"Resources,omitempty"`
	// Starting index of all the results that matched the request filters. First
	// item is number 1.
	StartIndex int64 `json:"startIndex,omitempty"`
	// Total results that match the request filters.
	TotalResults int64 `json:"totalResults,omitempty"`
}

type ListServicePrincipalResponse

type ListServicePrincipalResponse struct {
	// Total results returned in the response.
	ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
	// User objects returned in the response.
	Resources []ServicePrincipal `json:"Resources,omitempty"`
	// Starting index of all the results that matched the request filters. First
	// item is number 1.
	StartIndex int64 `json:"startIndex,omitempty"`
	// Total results that match the request filters.
	TotalResults int64 `json:"totalResults,omitempty"`
}

type ListServicePrincipalsRequest

type ListServicePrincipalsRequest struct {
	// Comma-separated list of attributes to return in response.
	Attributes string `json:"-" url:"attributes,omitempty"`
	// Desired number of results per page.
	Count int `json:"-" url:"count,omitempty"`
	// Comma-separated list of attributes to exclude in response.
	ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"`
	// Query by which the results have to be filtered. Supported operators are
	// equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`).
	// Additionally, simple expressions can be formed using logical operators -
	// `and` and `or`. The [SCIM RFC] has more details but we currently only
	// support simple expressions.
	//
	// [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2
	Filter string `json:"-" url:"filter,omitempty"`
	// Attribute to sort the results.
	SortBy string `json:"-" url:"sortBy,omitempty"`
	// The order to sort the results.
	SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"`
	// Specifies the index of the first result. First item is number 1.
	StartIndex int `json:"-" url:"startIndex,omitempty"`
}

List service principals

type ListSortOrder

type ListSortOrder string
const ListSortOrderAscending ListSortOrder = `ascending`
const ListSortOrderDescending ListSortOrder = `descending`

func (*ListSortOrder) Set added in v0.2.0

func (lso *ListSortOrder) Set(v string) error

Set raw string value and validate it against allowed values

func (*ListSortOrder) String added in v0.2.0

func (lso *ListSortOrder) String() string

String representation for fmt.Print

func (*ListSortOrder) Type added in v0.2.0

func (lso *ListSortOrder) Type() string

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

type ListUsersRequest

type ListUsersRequest struct {
	// Comma-separated list of attributes to return in response.
	Attributes string `json:"-" url:"attributes,omitempty"`
	// Desired number of results per page.
	Count int `json:"-" url:"count,omitempty"`
	// Comma-separated list of attributes to exclude in response.
	ExcludedAttributes string `json:"-" url:"excludedAttributes,omitempty"`
	// Query by which the results have to be filtered. Supported operators are
	// equals(`eq`), contains(`co`), starts with(`sw`) and not equals(`ne`).
	// Additionally, simple expressions can be formed using logical operators -
	// `and` and `or`. The [SCIM RFC] has more details but we currently only
	// support simple expressions.
	//
	// [SCIM RFC]: https://tools.ietf.org/html/rfc7644#section-3.4.2.2
	Filter string `json:"-" url:"filter,omitempty"`
	// Attribute to sort the results. Multi-part paths are supported. For
	// example, `userName`, `name.givenName`, and `emails`.
	SortBy string `json:"-" url:"sortBy,omitempty"`
	// The order to sort the results.
	SortOrder ListSortOrder `json:"-" url:"sortOrder,omitempty"`
	// Specifies the index of the first result. First item is number 1.
	StartIndex int `json:"-" url:"startIndex,omitempty"`
}

List users

type ListUsersResponse

type ListUsersResponse struct {
	// Total results returned in the response.
	ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
	// User objects returned in the response.
	Resources []User `json:"Resources,omitempty"`
	// Starting index of all the results that matched the request filters. First
	// item is number 1.
	StartIndex int64 `json:"startIndex,omitempty"`
	// Total results that match the request filters.
	TotalResults int64 `json:"totalResults,omitempty"`
}

type Name

type Name struct {
	// Family name of the Databricks user.
	FamilyName string `json:"familyName,omitempty"`
	// Given name of the Databricks user.
	GivenName string `json:"givenName,omitempty"`
}

type PartialUpdate

type PartialUpdate struct {
	// Unique ID for a group in the Databricks Account.
	Id string `json:"-" url:"-"`

	Operations []Patch `json:"operations,omitempty"`
}

type Patch

type Patch struct {
	// Type of patch operation.
	Op PatchOp `json:"op,omitempty"`
	// Selection of patch operation
	Path string `json:"path,omitempty"`
	// Value to modify
	Value string `json:"value,omitempty"`
}

type PatchOp

type PatchOp string

Type of patch operation.

const PatchOpAdd PatchOp = `add`
const PatchOpRemove PatchOp = `remove`
const PatchOpReplace PatchOp = `replace`

func (*PatchOp) Set added in v0.2.0

func (po *PatchOp) Set(v string) error

Set raw string value and validate it against allowed values

func (*PatchOp) String added in v0.2.0

func (po *PatchOp) String() string

String representation for fmt.Print

func (*PatchOp) Type added in v0.2.0

func (po *PatchOp) Type() string

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

type ServicePrincipal

type ServicePrincipal struct {
	// If this user is active
	Active bool `json:"active,omitempty"`
	// UUID relating to the service principal
	ApplicationId string `json:"applicationId,omitempty"`
	// String that represents a concatenation of given and family names.
	DisplayName string `json:"displayName,omitempty"`

	Entitlements []ComplexValue `json:"entitlements,omitempty"`

	ExternalId string `json:"externalId,omitempty"`

	Groups []ComplexValue `json:"groups,omitempty"`
	// Databricks service principal ID.
	Id string `json:"id,omitempty" url:"-"`

	Roles []ComplexValue `json:"roles,omitempty"`
}

type ServicePrincipalsAPI

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

Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. Databricks recommends creating service principals to run production jobs or modify production data. If all processes that act on production data run with service principals, interactive users do not need any write, delete, or modify privileges in production. This eliminates the risk of a user overwriting production data by accident.

func NewServicePrincipals

func NewServicePrincipals(client *client.DatabricksClient) *ServicePrincipalsAPI

func (*ServicePrincipalsAPI) Create

Create a service principal.

Creates a new service principal in the Databricks Workspace.

func (*ServicePrincipalsAPI) Delete

Delete a service principal.

Delete a single service principal in the Databricks Workspace.

func (*ServicePrincipalsAPI) DeleteById

func (a *ServicePrincipalsAPI) DeleteById(ctx context.Context, id string) error

Delete a service principal.

Delete a single service principal in the Databricks Workspace.

func (*ServicePrincipalsAPI) Get

Get service principal details.

Gets the details for a single service principal define in the Databricks Workspace.

func (*ServicePrincipalsAPI) GetByDisplayName

func (a *ServicePrincipalsAPI) GetByDisplayName(ctx context.Context, name string) (*ServicePrincipal, error)

GetByDisplayName calls ServicePrincipalsAPI.ServicePrincipalDisplayNameToIdMap and returns a single ServicePrincipal.

Returns an error if there's more than one ServicePrincipal with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*ServicePrincipalsAPI) GetById

Get service principal details.

Gets the details for a single service principal define in the Databricks Workspace.

func (*ServicePrincipalsAPI) Impl

Impl returns low-level ServicePrincipals API implementation

func (*ServicePrincipalsAPI) ListAll

List service principals.

Gets the set of service principals associated with a Databricks Workspace.

This method is generated by Databricks SDK Code Generator.

func (*ServicePrincipalsAPI) Patch

func (a *ServicePrincipalsAPI) Patch(ctx context.Context, request PartialUpdate) error

Update service principal details.

Partially updates the details of a single service principal in the Databricks Workspace.

func (*ServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap

func (a *ServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListServicePrincipalsRequest) (map[string]string, error)

ServicePrincipalDisplayNameToIdMap calls ServicePrincipalsAPI.ListAll and creates a map of results with ServicePrincipal.DisplayName as key and ServicePrincipal.Id as value.

Returns an error if there's more than one ServicePrincipal with the same .DisplayName.

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

This method is generated by Databricks SDK Code Generator.

func (*ServicePrincipalsAPI) Update

func (a *ServicePrincipalsAPI) Update(ctx context.Context, request ServicePrincipal) error

Replace service principal.

Updates the details of a single service principal.

This action replaces the existing service principal with the same name.

func (*ServicePrincipalsAPI) WithImpl

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

type ServicePrincipalsService

type ServicePrincipalsService interface {

	// Create a service principal.
	//
	// Creates a new service principal in the Databricks Workspace.
	Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)

	// Delete a service principal.
	//
	// Delete a single service principal in the Databricks Workspace.
	Delete(ctx context.Context, request DeleteServicePrincipalRequest) error

	// Get service principal details.
	//
	// Gets the details for a single service principal define in the Databricks
	// Workspace.
	Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)

	// List service principals.
	//
	// Gets the set of service principals associated with a Databricks
	// Workspace.
	//
	// Use ListAll() to get all ServicePrincipal instances
	List(ctx context.Context, request ListServicePrincipalsRequest) (*ListServicePrincipalResponse, error)

	// Update service principal details.
	//
	// Partially updates the details of a single service principal in the
	// Databricks Workspace.
	Patch(ctx context.Context, request PartialUpdate) error

	// Replace service principal.
	//
	// Updates the details of a single service principal.
	//
	// This action replaces the existing service principal with the same name.
	Update(ctx context.Context, request ServicePrincipal) error
}

Identities for use with jobs, automated tools, and systems such as scripts, apps, and CI/CD platforms. Databricks recommends creating service principals to run production jobs or modify production data. If all processes that act on production data run with service principals, interactive users do not need any write, delete, or modify privileges in production. This eliminates the risk of a user overwriting production data by accident.

type User

type User struct {
	// If this user is active
	Active bool `json:"active,omitempty"`
	// String that represents a concatenation of given and family names. For
	// example `John Smith`.
	DisplayName string `json:"displayName,omitempty"`
	// All the emails associated with the Databricks user.
	Emails []ComplexValue `json:"emails,omitempty"`

	Entitlements []ComplexValue `json:"entitlements,omitempty"`

	ExternalId string `json:"externalId,omitempty"`

	Groups []ComplexValue `json:"groups,omitempty"`
	// Databricks user ID.
	Id string `json:"id,omitempty" url:"-"`

	Name *Name `json:"name,omitempty"`

	Roles []ComplexValue `json:"roles,omitempty"`
	// Email address of the Databricks user.
	UserName string `json:"userName,omitempty"`
}

type UsersAPI

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

User identities recognized by Databricks and represented by email addresses.

Databricks recommends using SCIM provisioning to sync users and groups automatically from your identity provider to your Databricks Workspace. SCIM streamlines onboarding a new employee or team by using your identity provider to create users and groups in Databricks Workspace and give them the proper level of access. When a user leaves your organization or no longer needs access to Databricks Workspace, admins can terminate the user in your identity provider and that user’s account will also be removed from Databricks Workspace. This ensures a consistent offboarding process and prevents unauthorized users from accessing sensitive data.

func NewUsers

func NewUsers(client *client.DatabricksClient) *UsersAPI

func (*UsersAPI) Create

func (a *UsersAPI) Create(ctx context.Context, request User) (*User, error)

Create a new user.

Creates a new user in the Databricks Workspace. This new user will also be added to the Databricks account.

func (*UsersAPI) Delete

func (a *UsersAPI) Delete(ctx context.Context, request DeleteUserRequest) error

Delete a user.

Deletes a user. Deleting a user from a Databricks Workspace also removes objects associated with the user.

func (*UsersAPI) DeleteById

func (a *UsersAPI) DeleteById(ctx context.Context, id string) error

Delete a user.

Deletes a user. Deleting a user from a Databricks Workspace also removes objects associated with the user.

func (*UsersAPI) Get

func (a *UsersAPI) Get(ctx context.Context, request GetUserRequest) (*User, error)

Get user details.

Gets information for a specific user in Databricks Workspace.

func (*UsersAPI) GetById

func (a *UsersAPI) GetById(ctx context.Context, id string) (*User, error)

Get user details.

Gets information for a specific user in Databricks Workspace.

func (*UsersAPI) GetByUserName

func (a *UsersAPI) GetByUserName(ctx context.Context, name string) (*User, error)

GetByUserName calls UsersAPI.UserUserNameToIdMap and returns a single User.

Returns an error if there's more than one User with the same .UserName.

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

This method is generated by Databricks SDK Code Generator.

func (*UsersAPI) Impl

func (a *UsersAPI) Impl() UsersService

Impl returns low-level Users API implementation

func (*UsersAPI) ListAll

func (a *UsersAPI) ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)

List users.

Gets details for all the users associated with a Databricks Workspace.

This method is generated by Databricks SDK Code Generator.

func (*UsersAPI) Patch

func (a *UsersAPI) Patch(ctx context.Context, request PartialUpdate) error

Update user details.

Partially updates a user resource by applying the supplied operations on specific user attributes.

func (*UsersAPI) Update

func (a *UsersAPI) Update(ctx context.Context, request User) error

Replace a user.

Replaces a user's information with the data supplied in request.

func (*UsersAPI) UserUserNameToIdMap

func (a *UsersAPI) UserUserNameToIdMap(ctx context.Context, request ListUsersRequest) (map[string]string, error)

UserUserNameToIdMap calls UsersAPI.ListAll and creates a map of results with User.UserName as key and User.Id as value.

Returns an error if there's more than one User with the same .UserName.

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

This method is generated by Databricks SDK Code Generator.

func (*UsersAPI) WithImpl

func (a *UsersAPI) WithImpl(impl UsersService) *UsersAPI

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

type UsersService

type UsersService interface {

	// Create a new user.
	//
	// Creates a new user in the Databricks Workspace. This new user will also
	// be added to the Databricks account.
	Create(ctx context.Context, request User) (*User, error)

	// Delete a user.
	//
	// Deletes a user. Deleting a user from a Databricks Workspace also removes
	// objects associated with the user.
	Delete(ctx context.Context, request DeleteUserRequest) error

	// Get user details.
	//
	// Gets information for a specific user in Databricks Workspace.
	Get(ctx context.Context, request GetUserRequest) (*User, error)

	// List users.
	//
	// Gets details for all the users associated with a Databricks Workspace.
	//
	// Use ListAll() to get all User instances
	List(ctx context.Context, request ListUsersRequest) (*ListUsersResponse, error)

	// Update user details.
	//
	// Partially updates a user resource by applying the supplied operations on
	// specific user attributes.
	Patch(ctx context.Context, request PartialUpdate) error

	// Replace a user.
	//
	// Replaces a user's information with the data supplied in request.
	Update(ctx context.Context, request User) error
}

User identities recognized by Databricks and represented by email addresses.

Databricks recommends using SCIM provisioning to sync users and groups automatically from your identity provider to your Databricks Workspace. SCIM streamlines onboarding a new employee or team by using your identity provider to create users and groups in Databricks Workspace and give them the proper level of access. When a user leaves your organization or no longer needs access to Databricks Workspace, admins can terminate the user in your identity provider and that user’s account will also be removed from Databricks Workspace. This ensures a consistent offboarding process and prevents unauthorized users from accessing sensitive data.

Jump to

Keyboard shortcuts

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