Documentation
¶
Overview ¶
These APIs allow you to manage Access Control, Account Access Control, Account Access Control Proxy, Account Groups V2, Account Service Principals V2, Account Users V2, Current User, Groups V2, Permission Migration, Permissions, Service Principals V2, Users V2, Workspace Assignment, etc.
Index ¶
- type AccessControlAPI
- type AccessControlInterface
- type AccessControlRequest
- type AccessControlResponse
- type AccessControlServicedeprecated
- type AccountAccessControlAPI
- func (a *AccountAccessControlAPI) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
- func (a *AccountAccessControlAPI) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
- func (a *AccountAccessControlAPI) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
- type AccountAccessControlInterface
- type AccountAccessControlProxyAPI
- func (a *AccountAccessControlProxyAPI) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
- func (a *AccountAccessControlProxyAPI) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
- func (a *AccountAccessControlProxyAPI) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
- type AccountAccessControlProxyInterface
- type AccountAccessControlProxyServicedeprecated
- type AccountAccessControlServicedeprecated
- type AccountGroup
- type AccountGroupsAPI
- func (a *AccountGroupsAPI) Create(ctx context.Context, request Group) (*Group, error)
- func (a *AccountGroupsAPI) Delete(ctx context.Context, request DeleteAccountGroupRequest) error
- func (a *AccountGroupsAPI) DeleteById(ctx context.Context, id string) error
- func (a *AccountGroupsAPI) Get(ctx context.Context, request GetAccountGroupRequest) (*Group, error)
- func (a *AccountGroupsAPI) GetByDisplayName(ctx context.Context, name string) (*Group, error)
- func (a *AccountGroupsAPI) GetById(ctx context.Context, id string) (*Group, error)
- func (a *AccountGroupsAPI) GroupDisplayNameToIdMap(ctx context.Context, request ListAccountGroupsRequest) (map[string]string, error)
- func (a *AccountGroupsAPI) List(ctx context.Context, request ListAccountGroupsRequest) listing.Iterator[Group]
- func (a *AccountGroupsAPI) ListAll(ctx context.Context, request ListAccountGroupsRequest) ([]Group, error)
- func (a *AccountGroupsAPI) Patch(ctx context.Context, request PartialUpdate) error
- func (a *AccountGroupsAPI) Update(ctx context.Context, request Group) error
- type AccountGroupsInterface
- type AccountGroupsServicedeprecated
- type AccountGroupsV2API
- func (a *AccountGroupsV2API) Create(ctx context.Context, request CreateAccountGroupRequest) (*AccountGroup, error)
- func (a *AccountGroupsV2API) Delete(ctx context.Context, request DeleteAccountGroupRequest) error
- func (a *AccountGroupsV2API) Get(ctx context.Context, request GetAccountGroupRequest) (*AccountGroup, error)
- func (a *AccountGroupsV2API) List(ctx context.Context, request ListAccountGroupsRequest) listing.Iterator[AccountGroup]
- func (a *AccountGroupsV2API) ListAll(ctx context.Context, request ListAccountGroupsRequest) ([]AccountGroup, error)
- func (a *AccountGroupsV2API) Patch(ctx context.Context, request PatchAccountGroupRequest) error
- func (a *AccountGroupsV2API) Update(ctx context.Context, request UpdateAccountGroupRequest) error
- type AccountGroupsV2Interface
- type AccountGroupsV2Servicedeprecated
- type AccountServicePrincipal
- type AccountServicePrincipalsAPI
- func (a *AccountServicePrincipalsAPI) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
- func (a *AccountServicePrincipalsAPI) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
- func (a *AccountServicePrincipalsAPI) DeleteById(ctx context.Context, id string) error
- func (a *AccountServicePrincipalsAPI) Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*ServicePrincipal, error)
- func (a *AccountServicePrincipalsAPI) GetByDisplayName(ctx context.Context, name string) (*ServicePrincipal, error)
- func (a *AccountServicePrincipalsAPI) GetById(ctx context.Context, id string) (*ServicePrincipal, error)
- func (a *AccountServicePrincipalsAPI) List(ctx context.Context, request ListAccountServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
- func (a *AccountServicePrincipalsAPI) ListAll(ctx context.Context, request ListAccountServicePrincipalsRequest) ([]ServicePrincipal, error)
- func (a *AccountServicePrincipalsAPI) Patch(ctx context.Context, request PartialUpdate) error
- func (a *AccountServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListAccountServicePrincipalsRequest) (map[string]string, error)
- func (a *AccountServicePrincipalsAPI) Update(ctx context.Context, request ServicePrincipal) error
- type AccountServicePrincipalsInterface
- type AccountServicePrincipalsServicedeprecated
- type AccountServicePrincipalsV2API
- func (a *AccountServicePrincipalsV2API) Create(ctx context.Context, request CreateAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
- func (a *AccountServicePrincipalsV2API) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
- func (a *AccountServicePrincipalsV2API) Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
- func (a *AccountServicePrincipalsV2API) List(ctx context.Context, request ListAccountServicePrincipalsRequest) listing.Iterator[AccountServicePrincipal]
- func (a *AccountServicePrincipalsV2API) ListAll(ctx context.Context, request ListAccountServicePrincipalsRequest) ([]AccountServicePrincipal, error)
- func (a *AccountServicePrincipalsV2API) Patch(ctx context.Context, request PatchAccountServicePrincipalRequest) error
- func (a *AccountServicePrincipalsV2API) Update(ctx context.Context, request UpdateAccountServicePrincipalRequest) error
- type AccountServicePrincipalsV2Interface
- type AccountServicePrincipalsV2Servicedeprecated
- type AccountUser
- type AccountUsersAPI
- func (a *AccountUsersAPI) Create(ctx context.Context, request User) (*User, error)
- func (a *AccountUsersAPI) Delete(ctx context.Context, request DeleteAccountUserRequest) error
- func (a *AccountUsersAPI) DeleteById(ctx context.Context, id string) error
- func (a *AccountUsersAPI) Get(ctx context.Context, request GetAccountUserRequest) (*User, error)
- func (a *AccountUsersAPI) GetById(ctx context.Context, id string) (*User, error)
- func (a *AccountUsersAPI) GetByUserName(ctx context.Context, name string) (*User, error)
- func (a *AccountUsersAPI) List(ctx context.Context, request ListAccountUsersRequest) listing.Iterator[User]
- func (a *AccountUsersAPI) ListAll(ctx context.Context, request ListAccountUsersRequest) ([]User, error)
- func (a *AccountUsersAPI) Patch(ctx context.Context, request PartialUpdate) error
- func (a *AccountUsersAPI) Update(ctx context.Context, request User) error
- func (a *AccountUsersAPI) UserUserNameToIdMap(ctx context.Context, request ListAccountUsersRequest) (map[string]string, error)
- type AccountUsersInterface
- type AccountUsersServicedeprecated
- type AccountUsersV2API
- func (a *AccountUsersV2API) Create(ctx context.Context, request CreateAccountUserRequest) (*AccountUser, error)
- func (a *AccountUsersV2API) Delete(ctx context.Context, request DeleteAccountUserRequest) error
- func (a *AccountUsersV2API) Get(ctx context.Context, request GetAccountUserRequest) (*AccountUser, error)
- func (a *AccountUsersV2API) List(ctx context.Context, request ListAccountUsersRequest) listing.Iterator[AccountUser]
- func (a *AccountUsersV2API) ListAll(ctx context.Context, request ListAccountUsersRequest) ([]AccountUser, error)
- func (a *AccountUsersV2API) Patch(ctx context.Context, request PatchAccountUserRequest) error
- func (a *AccountUsersV2API) Update(ctx context.Context, request UpdateAccountUserRequest) error
- type AccountUsersV2Interface
- type AccountUsersV2Servicedeprecated
- type Actor
- type CheckPolicyRequest
- type CheckPolicyResponse
- type ComplexValue
- type ConsistencyToken
- type CreateAccountGroupRequest
- type CreateAccountServicePrincipalRequest
- type CreateAccountUserRequest
- type CreateGroupRequest
- type CreateServicePrincipalRequest
- type CreateUserRequest
- type CurrentUserAPI
- type CurrentUserInterface
- type CurrentUserServicedeprecated
- type DeleteAccountGroupRequest
- type DeleteAccountServicePrincipalRequest
- type DeleteAccountUserRequest
- type DeleteGroupRequest
- type DeleteServicePrincipalRequest
- type DeleteUserRequest
- type DeleteWorkspaceAssignmentRequest
- type GetAccountGroupRequest
- type GetAccountServicePrincipalRequest
- type GetAccountUserRequest
- type GetAssignableRolesForResourceRequest
- type GetAssignableRolesForResourceResponse
- type GetGroupRequest
- type GetPasswordPermissionLevelsRequest
- type GetPasswordPermissionLevelsResponse
- type GetPasswordPermissionsRequest
- type GetPermissionLevelsRequest
- type GetPermissionLevelsResponse
- type GetPermissionRequest
- type GetRuleSetRequest
- type GetServicePrincipalRequest
- type GetSortOrder
- type GetUserRequest
- type GetWorkspaceAssignmentRequest
- type GrantRule
- type Group
- type GroupSchema
- type GroupsAPI
- func (a *GroupsAPI) Create(ctx context.Context, request Group) (*Group, error)
- func (a *GroupsAPI) Delete(ctx context.Context, request DeleteGroupRequest) error
- func (a *GroupsAPI) DeleteById(ctx context.Context, id string) error
- func (a *GroupsAPI) Get(ctx context.Context, request GetGroupRequest) (*Group, error)
- func (a *GroupsAPI) GetByDisplayName(ctx context.Context, name string) (*Group, error)
- func (a *GroupsAPI) GetById(ctx context.Context, id string) (*Group, error)
- func (a *GroupsAPI) GroupDisplayNameToIdMap(ctx context.Context, request ListGroupsRequest) (map[string]string, error)
- func (a *GroupsAPI) List(ctx context.Context, request ListGroupsRequest) listing.Iterator[Group]
- func (a *GroupsAPI) ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)
- func (a *GroupsAPI) Patch(ctx context.Context, request PartialUpdate) error
- func (a *GroupsAPI) Update(ctx context.Context, request Group) error
- type GroupsInterface
- type GroupsServicedeprecated
- type GroupsV2API
- func (a *GroupsV2API) Create(ctx context.Context, request CreateGroupRequest) (*Group, error)
- func (a *GroupsV2API) Delete(ctx context.Context, request DeleteGroupRequest) error
- func (a *GroupsV2API) Get(ctx context.Context, request GetGroupRequest) (*Group, error)
- func (a *GroupsV2API) List(ctx context.Context, request ListGroupsRequest) listing.Iterator[Group]
- func (a *GroupsV2API) ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)
- func (a *GroupsV2API) Patch(ctx context.Context, request PatchGroupRequest) error
- func (a *GroupsV2API) Update(ctx context.Context, request UpdateGroupRequest) error
- type GroupsV2Interface
- type GroupsV2Servicedeprecated
- type ListAccountGroupsRequest
- type ListAccountGroupsResponse
- type ListAccountServicePrincipalsRequest
- type ListAccountServicePrincipalsResponse
- type ListAccountUsersRequest
- type ListAccountUsersResponse
- type ListGroupsRequest
- type ListGroupsResponse
- type ListResponseSchema
- type ListServicePrincipalResponse
- type ListServicePrincipalsRequest
- type ListSortOrder
- type ListUsersRequest
- type ListUsersResponse
- type ListWorkspaceAssignmentRequest
- type MigratePermissionsRequest
- type MigratePermissionsResponse
- type Name
- type ObjectPermissions
- type PartialUpdate
- type PasswordAccessControlRequest
- type PasswordAccessControlResponse
- type PasswordPermission
- type PasswordPermissionLevel
- type PasswordPermissions
- type PasswordPermissionsDescription
- type PasswordPermissionsRequest
- type Patch
- type PatchAccountGroupRequest
- type PatchAccountServicePrincipalRequest
- type PatchAccountUserRequest
- type PatchGroupRequest
- type PatchOp
- type PatchSchema
- type PatchServicePrincipalRequest
- type PatchUserRequest
- type Permission
- type PermissionAssignment
- type PermissionAssignments
- type PermissionLevel
- type PermissionMigrationAPI
- type PermissionMigrationInterface
- type PermissionMigrationServicedeprecated
- type PermissionOutput
- type PermissionsAPI
- func (a *PermissionsAPI) Get(ctx context.Context, request GetPermissionRequest) (*ObjectPermissions, error)
- func (a *PermissionsAPI) GetByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*ObjectPermissions, error)
- func (a *PermissionsAPI) GetPermissionLevels(ctx context.Context, request GetPermissionLevelsRequest) (*GetPermissionLevelsResponse, error)
- func (a *PermissionsAPI) GetPermissionLevelsByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*GetPermissionLevelsResponse, error)
- func (a *PermissionsAPI) Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error)
- func (a *PermissionsAPI) Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error)
- type PermissionsDescription
- type PermissionsInterface
- type PermissionsServicedeprecated
- type PrincipalOutput
- type RequestAuthzIdentity
- type ResourceInfo
- type ResourceMeta
- type Role
- type RuleSetResponse
- type RuleSetUpdateRequest
- type ServicePrincipal
- type ServicePrincipalSchema
- type ServicePrincipalsAPI
- func (a *ServicePrincipalsAPI) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
- func (a *ServicePrincipalsAPI) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
- func (a *ServicePrincipalsAPI) DeleteById(ctx context.Context, id string) error
- func (a *ServicePrincipalsAPI) Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
- func (a *ServicePrincipalsAPI) GetByDisplayName(ctx context.Context, name string) (*ServicePrincipal, error)
- func (a *ServicePrincipalsAPI) GetById(ctx context.Context, id string) (*ServicePrincipal, error)
- func (a *ServicePrincipalsAPI) List(ctx context.Context, request ListServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
- func (a *ServicePrincipalsAPI) ListAll(ctx context.Context, request ListServicePrincipalsRequest) ([]ServicePrincipal, error)
- func (a *ServicePrincipalsAPI) Patch(ctx context.Context, request PartialUpdate) error
- func (a *ServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListServicePrincipalsRequest) (map[string]string, error)
- func (a *ServicePrincipalsAPI) Update(ctx context.Context, request ServicePrincipal) error
- type ServicePrincipalsInterface
- type ServicePrincipalsServicedeprecated
- type ServicePrincipalsV2API
- func (a *ServicePrincipalsV2API) Create(ctx context.Context, request CreateServicePrincipalRequest) (*ServicePrincipal, error)
- func (a *ServicePrincipalsV2API) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
- func (a *ServicePrincipalsV2API) Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
- func (a *ServicePrincipalsV2API) List(ctx context.Context, request ListServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
- func (a *ServicePrincipalsV2API) ListAll(ctx context.Context, request ListServicePrincipalsRequest) ([]ServicePrincipal, error)
- func (a *ServicePrincipalsV2API) Patch(ctx context.Context, request PatchServicePrincipalRequest) error
- func (a *ServicePrincipalsV2API) Update(ctx context.Context, request UpdateServicePrincipalRequest) error
- type ServicePrincipalsV2Interface
- type ServicePrincipalsV2Servicedeprecated
- type SetObjectPermissions
- type UpdateAccountGroupRequest
- type UpdateAccountServicePrincipalRequest
- type UpdateAccountUserRequest
- type UpdateGroupRequest
- type UpdateObjectPermissions
- type UpdateRuleSetRequest
- type UpdateServicePrincipalRequest
- type UpdateUserRequest
- type UpdateWorkspaceAssignments
- type User
- type UserSchema
- type UsersAPI
- func (a *UsersAPI) Create(ctx context.Context, request User) (*User, error)
- func (a *UsersAPI) Delete(ctx context.Context, request DeleteUserRequest) error
- func (a *UsersAPI) DeleteById(ctx context.Context, id string) error
- func (a *UsersAPI) Get(ctx context.Context, request GetUserRequest) (*User, error)
- func (a *UsersAPI) GetById(ctx context.Context, id string) (*User, error)
- func (a *UsersAPI) GetByUserName(ctx context.Context, name string) (*User, error)
- func (a *UsersAPI) GetPermissionLevels(ctx context.Context) (*GetPasswordPermissionLevelsResponse, error)
- func (a *UsersAPI) GetPermissions(ctx context.Context) (*PasswordPermissions, error)
- func (a *UsersAPI) List(ctx context.Context, request ListUsersRequest) listing.Iterator[User]
- func (a *UsersAPI) ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)
- func (a *UsersAPI) Patch(ctx context.Context, request PartialUpdate) error
- func (a *UsersAPI) SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
- func (a *UsersAPI) Update(ctx context.Context, request User) error
- func (a *UsersAPI) UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
- func (a *UsersAPI) UserUserNameToIdMap(ctx context.Context, request ListUsersRequest) (map[string]string, error)
- type UsersInterface
- type UsersServicedeprecated
- type UsersV2API
- func (a *UsersV2API) Create(ctx context.Context, request CreateUserRequest) (*User, error)
- func (a *UsersV2API) Delete(ctx context.Context, request DeleteUserRequest) error
- func (a *UsersV2API) Get(ctx context.Context, request GetUserRequest) (*User, error)
- func (a *UsersV2API) GetPermissionLevels(ctx context.Context, request GetPasswordPermissionLevelsRequest) (*GetPasswordPermissionLevelsResponse, error)
- func (a *UsersV2API) GetPermissions(ctx context.Context, request GetPasswordPermissionsRequest) (*PasswordPermissions, error)
- func (a *UsersV2API) List(ctx context.Context, request ListUsersRequest) listing.Iterator[User]
- func (a *UsersV2API) ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)
- func (a *UsersV2API) Patch(ctx context.Context, request PatchUserRequest) error
- func (a *UsersV2API) SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
- func (a *UsersV2API) Update(ctx context.Context, request UpdateUserRequest) error
- func (a *UsersV2API) UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
- type UsersV2Interface
- type UsersV2Servicedeprecated
- type WorkspaceAssignmentAPI
- func (a *WorkspaceAssignmentAPI) Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error
- func (a *WorkspaceAssignmentAPI) DeleteByWorkspaceIdAndPrincipalId(ctx context.Context, workspaceId int64, principalId int64) error
- func (a *WorkspaceAssignmentAPI) Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error)
- func (a *WorkspaceAssignmentAPI) GetByWorkspaceId(ctx context.Context, workspaceId int64) (*WorkspacePermissions, error)
- func (a *WorkspaceAssignmentAPI) List(ctx context.Context, request ListWorkspaceAssignmentRequest) listing.Iterator[PermissionAssignment]
- func (a *WorkspaceAssignmentAPI) ListAll(ctx context.Context, request ListWorkspaceAssignmentRequest) ([]PermissionAssignment, error)
- func (a *WorkspaceAssignmentAPI) ListByWorkspaceId(ctx context.Context, workspaceId int64) (*PermissionAssignments, error)
- func (a *WorkspaceAssignmentAPI) Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error)
- type WorkspaceAssignmentInterface
- type WorkspaceAssignmentServicedeprecated
- type WorkspacePermission
- type WorkspacePermissions
Examples ¶
- CurrentUserAPI.Me (CurrentUser)
- CurrentUserAPI.Me (Tokens)
- GroupsAPI.Create (GenericPermissions)
- GroupsAPI.Create (Groups)
- GroupsAPI.Create (Secrets)
- GroupsAPI.Delete (GenericPermissions)
- GroupsAPI.Delete (Groups)
- GroupsAPI.Delete (Secrets)
- GroupsAPI.Get (Groups)
- PermissionsAPI.Get (GenericPermissions)
- PermissionsAPI.GetPermissionLevels (GenericPermissions)
- PermissionsAPI.Set (GenericPermissions)
- ServicePrincipalsAPI.Create (AccountServicePrincipal)
- ServicePrincipalsAPI.Create (CreateOboTokenOnAws)
- ServicePrincipalsAPI.Create (ServicePrincipalsOnAws)
- ServicePrincipalsAPI.Create (WorkspaceAssignmentOnAws)
- ServicePrincipalsAPI.Get (AccountServicePrincipal)
- ServicePrincipalsAPI.Get (ServicePrincipalsOnAws)
- ServicePrincipalsAPI.List (AccountServicePrincipal)
- ServicePrincipalsAPI.List (ServicePrincipalsOnAws)
- ServicePrincipalsAPI.Patch (AccountServicePrincipal)
- ServicePrincipalsAPI.Patch (ServicePrincipalsOnAws)
- ServicePrincipalsAPI.Update (AccountServicePrincipal)
- ServicePrincipalsAPI.Update (ServicePrincipalsOnAws)
- UsersAPI.Create (AccountUsers)
- UsersAPI.Create (ClustersApiIntegration)
- UsersAPI.Create (WorkspaceUsers)
- UsersAPI.Delete (AccountUsers)
- UsersAPI.Delete (ClustersApiIntegration)
- UsersAPI.Delete (WorkspaceUsers)
- UsersAPI.Get (AccountUsers)
- UsersAPI.Get (WorkspaceUsers)
- UsersAPI.List (WorkspaceUsers)
- UsersAPI.Patch (AccountUsers)
- UsersAPI.Patch (WorkspaceUsers)
- UsersAPI.Update (WorkspaceUsers)
- WorkspaceAssignmentAPI.List (WorkspaceAssignmentOnAws)
- WorkspaceAssignmentAPI.Update (WorkspaceAssignmentOnAws)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControlAPI ¶ added in v0.56.0
type AccessControlAPI struct {
// contains filtered or unexported fields
}
Rule based Access Control for Databricks Resources.
func NewAccessControl ¶ added in v0.56.0
func NewAccessControl(client *client.DatabricksClient) *AccessControlAPI
func (*AccessControlAPI) CheckPolicy ¶ added in v0.56.0
func (a *AccessControlAPI) CheckPolicy(ctx context.Context, request CheckPolicyRequest) (*CheckPolicyResponse, error)
type AccessControlInterface ¶ added in v0.56.0
type AccessControlInterface interface {
// Check access policy to a resource.
CheckPolicy(ctx context.Context, request CheckPolicyRequest) (*CheckPolicyResponse, error)
}
type AccessControlRequest ¶
type AccessControlRequest struct {
// name of the group
GroupName string `json:"group_name,omitempty"`
PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
// application ID of a service principal
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (AccessControlRequest) MarshalJSON ¶ added in v0.23.0
func (s AccessControlRequest) MarshalJSON() ([]byte, error)
func (*AccessControlRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *AccessControlRequest) UnmarshalJSON(b []byte) error
type AccessControlResponse ¶
type AccessControlResponse struct {
// All permissions.
AllPermissions []Permission `json:"all_permissions,omitempty"`
// Display name of the user or service principal.
DisplayName string `json:"display_name,omitempty"`
// name of the group
GroupName string `json:"group_name,omitempty"`
// Name of the service principal.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (AccessControlResponse) MarshalJSON ¶ added in v0.23.0
func (s AccessControlResponse) MarshalJSON() ([]byte, error)
func (*AccessControlResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *AccessControlResponse) UnmarshalJSON(b []byte) error
type AccessControlService
deprecated
added in
v0.56.0
type AccessControlService interface {
// Check access policy to a resource.
CheckPolicy(ctx context.Context, request CheckPolicyRequest) (*CheckPolicyResponse, error)
}
Rule based Access Control for Databricks Resources.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountAccessControlAPI ¶ added in v0.10.0
type AccountAccessControlAPI struct {
// contains filtered or unexported fields
}
These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is called a rule set.
func NewAccountAccessControl ¶ added in v0.10.0
func NewAccountAccessControl(client *client.DatabricksClient) *AccountAccessControlAPI
func (*AccountAccessControlAPI) GetAssignableRolesForResource ¶ added in v0.10.0
func (a *AccountAccessControlAPI) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
func (*AccountAccessControlAPI) GetRuleSet ¶ added in v0.10.0
func (a *AccountAccessControlAPI) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
func (*AccountAccessControlAPI) UpdateRuleSet ¶ added in v0.10.0
func (a *AccountAccessControlAPI) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
type AccountAccessControlInterface ¶ added in v0.29.0
type AccountAccessControlInterface interface {
// Gets all the roles that can be granted on an account level resource. A role
// is grantable if the rule set on the resource can contain an access rule of
// the role.
GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
// Get a rule set by its name. A rule set is always attached to a resource and
// contains a list of access rules on the said resource. Currently only a
// default rule set for each resource is supported.
GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
// Replace the rules of a rule set. First, use get to read the current version
// of the rule set before modifying it. This pattern helps prevent conflicts
// between concurrent updates.
UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
}
type AccountAccessControlProxyAPI ¶ added in v0.10.0
type AccountAccessControlProxyAPI struct {
// contains filtered or unexported fields
}
These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is called a rule set. A workspace must belong to an account for these APIs to work
func NewAccountAccessControlProxy ¶ added in v0.10.0
func NewAccountAccessControlProxy(client *client.DatabricksClient) *AccountAccessControlProxyAPI
func (*AccountAccessControlProxyAPI) GetAssignableRolesForResource ¶ added in v0.10.0
func (a *AccountAccessControlProxyAPI) GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
func (*AccountAccessControlProxyAPI) GetRuleSet ¶ added in v0.10.0
func (a *AccountAccessControlProxyAPI) GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
func (*AccountAccessControlProxyAPI) UpdateRuleSet ¶ added in v0.10.0
func (a *AccountAccessControlProxyAPI) UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
type AccountAccessControlProxyInterface ¶ added in v0.29.0
type AccountAccessControlProxyInterface interface {
// Gets all the roles that can be granted on an account level resource. A role
// is grantable if the rule set on the resource can contain an access rule of
// the role.
GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
// Get a rule set by its name. A rule set is always attached to a resource and
// contains a list of access rules on the said resource. Currently only a
// default rule set for each resource is supported.
GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
// Replace the rules of a rule set. First, use get to read the current version
// of the rule set before modifying it. This pattern helps prevent conflicts
// between concurrent updates.
UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
}
type AccountAccessControlProxyService
deprecated
added in
v0.10.0
type AccountAccessControlProxyService interface {
// Gets all the roles that can be granted on an account level resource. A
// role is grantable if the rule set on the resource can contain an access
// rule of the role.
GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
// Get a rule set by its name. A rule set is always attached to a resource
// and contains a list of access rules on the said resource. Currently only
// a default rule set for each resource is supported.
GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
// Replace the rules of a rule set. First, use get to read the current
// version of the rule set before modifying it. This pattern helps prevent
// conflicts between concurrent updates.
UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
}
These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is called a rule set. A workspace must belong to an account for these APIs to work
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountAccessControlService
deprecated
added in
v0.10.0
type AccountAccessControlService interface {
// Gets all the roles that can be granted on an account level resource. A
// role is grantable if the rule set on the resource can contain an access
// rule of the role.
GetAssignableRolesForResource(ctx context.Context, request GetAssignableRolesForResourceRequest) (*GetAssignableRolesForResourceResponse, error)
// Get a rule set by its name. A rule set is always attached to a resource
// and contains a list of access rules on the said resource. Currently only
// a default rule set for each resource is supported.
GetRuleSet(ctx context.Context, request GetRuleSetRequest) (*RuleSetResponse, error)
// Replace the rules of a rule set. First, use get to read the current
// version of the rule set before modifying it. This pattern helps prevent
// conflicts between concurrent updates.
UpdateRuleSet(ctx context.Context, request UpdateRuleSetRequest) (*RuleSetResponse, error)
}
These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is called a rule set.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountGroup ¶ added in v0.84.0
type AccountGroup struct {
// Databricks account ID
AccountId string `json:"account_id,omitempty"`
// String that represents a human-readable group name
DisplayName string `json:"displayName,omitempty"`
// external_id should be unique for identifying groups
ExternalId string `json:"externalId,omitempty"`
// Databricks group ID
Id string `json:"id,omitempty"`
Members []ComplexValue `json:"members,omitempty"`
// Container for the group identifier. Workspace local versus account.
Meta *ResourceMeta `json:"meta,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (AccountGroup) MarshalJSON ¶ added in v0.84.0
func (s AccountGroup) MarshalJSON() ([]byte, error)
func (*AccountGroup) UnmarshalJSON ¶ added in v0.84.0
func (s *AccountGroup) UnmarshalJSON(b []byte) error
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) Delete ¶
func (a *AccountGroupsAPI) Delete(ctx context.Context, request DeleteAccountGroupRequest) error
func (*AccountGroupsAPI) DeleteById ¶
func (a *AccountGroupsAPI) DeleteById(ctx context.Context, id string) error
Deletes a group from the Databricks account.
func (*AccountGroupsAPI) Get ¶
func (a *AccountGroupsAPI) Get(ctx context.Context, request GetAccountGroupRequest) (*Group, error)
func (*AccountGroupsAPI) GetByDisplayName ¶
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 ¶
Gets the information for a specific group in the Databricks account.
func (*AccountGroupsAPI) GroupDisplayNameToIdMap ¶
func (a *AccountGroupsAPI) GroupDisplayNameToIdMap(ctx context.Context, request ListAccountGroupsRequest) (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) List ¶ added in v0.24.0
func (a *AccountGroupsAPI) List(ctx context.Context, request ListAccountGroupsRequest) listing.Iterator[Group]
Gets all details of the groups associated with the Databricks account.
func (*AccountGroupsAPI) ListAll ¶
func (a *AccountGroupsAPI) ListAll(ctx context.Context, request ListAccountGroupsRequest) ([]Group, error)
Gets all details of the groups associated with the Databricks account.
type AccountGroupsInterface ¶ added in v0.29.0
type AccountGroupsInterface interface {
// Creates a group in the Databricks account with a unique name, using the
// supplied group details.
Create(ctx context.Context, request Group) (*Group, error)
// Deletes a group from the Databricks account.
Delete(ctx context.Context, request DeleteAccountGroupRequest) error
// Deletes a group from the Databricks account.
DeleteById(ctx context.Context, id string) error
// Gets the information for a specific group in the Databricks account.
Get(ctx context.Context, request GetAccountGroupRequest) (*Group, error)
// Gets the information for a specific group in the Databricks account.
GetById(ctx context.Context, id string) (*Group, error)
// Gets all details of the groups associated with the Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListAccountGroupsRequest) listing.Iterator[Group]
// Gets all details of the groups associated with the Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListAccountGroupsRequest) ([]Group, 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.
GroupDisplayNameToIdMap(ctx context.Context, request ListAccountGroupsRequest) (map[string]string, 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.
GetByDisplayName(ctx context.Context, name string) (*Group, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PartialUpdate) error
// Updates the details of a group by replacing the entire group entity.
Update(ctx context.Context, request Group) error
}
type AccountGroupsService
deprecated
type AccountGroupsService interface {
// Creates a group in the Databricks account with a unique name, using the
// supplied group details.
Create(ctx context.Context, request Group) (*Group, error)
// Deletes a group from the Databricks account.
Delete(ctx context.Context, request DeleteAccountGroupRequest) error
// Gets the information for a specific group in the Databricks account.
Get(ctx context.Context, request GetAccountGroupRequest) (*Group, error)
// Gets all details of the groups associated with the Databricks account.
List(ctx context.Context, request ListAccountGroupsRequest) (*ListGroupsResponse, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PartialUpdate) error
// 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountGroupsV2API ¶ added in v0.84.0
type AccountGroupsV2API 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 NewAccountGroupsV2 ¶ added in v0.84.0
func NewAccountGroupsV2(client *client.DatabricksClient) *AccountGroupsV2API
func (*AccountGroupsV2API) Create ¶ added in v0.84.0
func (a *AccountGroupsV2API) Create(ctx context.Context, request CreateAccountGroupRequest) (*AccountGroup, error)
func (*AccountGroupsV2API) Delete ¶ added in v0.84.0
func (a *AccountGroupsV2API) Delete(ctx context.Context, request DeleteAccountGroupRequest) error
func (*AccountGroupsV2API) Get ¶ added in v0.84.0
func (a *AccountGroupsV2API) Get(ctx context.Context, request GetAccountGroupRequest) (*AccountGroup, error)
func (*AccountGroupsV2API) List ¶ added in v0.84.0
func (a *AccountGroupsV2API) List(ctx context.Context, request ListAccountGroupsRequest) listing.Iterator[AccountGroup]
Gets all details of the groups associated with the Databricks account. As of 08/22/2025, this endpoint will no longer return members. Instead, members should be retrieved by iterating through `Get group details`. Existing accounts that rely on this attribute will not be impacted and will continue receiving member data as before.
func (*AccountGroupsV2API) ListAll ¶ added in v0.84.0
func (a *AccountGroupsV2API) ListAll(ctx context.Context, request ListAccountGroupsRequest) ([]AccountGroup, error)
Gets all details of the groups associated with the Databricks account. As of 08/22/2025, this endpoint will no longer return members. Instead, members should be retrieved by iterating through `Get group details`. Existing accounts that rely on this attribute will not be impacted and will continue receiving member data as before.
type AccountGroupsV2Interface ¶ added in v0.84.0
type AccountGroupsV2Interface interface {
// Creates a group in the Databricks account with a unique name, using the
// supplied group details.
Create(ctx context.Context, request CreateAccountGroupRequest) (*AccountGroup, error)
// Deletes a group from the Databricks account.
Delete(ctx context.Context, request DeleteAccountGroupRequest) error
// Gets the information for a specific group in the Databricks account.
Get(ctx context.Context, request GetAccountGroupRequest) (*AccountGroup, error)
// Gets all details of the groups associated with the Databricks account. As of
// 08/22/2025, this endpoint will no longer return members. Instead, members
// should be retrieved by iterating through `Get group details`. Existing
// accounts that rely on this attribute will not be impacted and will continue
// receiving member data as before.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListAccountGroupsRequest) listing.Iterator[AccountGroup]
// Gets all details of the groups associated with the Databricks account. As of
// 08/22/2025, this endpoint will no longer return members. Instead, members
// should be retrieved by iterating through `Get group details`. Existing
// accounts that rely on this attribute will not be impacted and will continue
// receiving member data as before.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListAccountGroupsRequest) ([]AccountGroup, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PatchAccountGroupRequest) error
// Updates the details of a group by replacing the entire group entity.
Update(ctx context.Context, request UpdateAccountGroupRequest) error
}
type AccountGroupsV2Service
deprecated
added in
v0.84.0
type AccountGroupsV2Service interface {
// Creates a group in the Databricks account with a unique name, using the
// supplied group details.
Create(ctx context.Context, request CreateAccountGroupRequest) (*AccountGroup, error)
// Deletes a group from the Databricks account.
Delete(ctx context.Context, request DeleteAccountGroupRequest) error
// Gets the information for a specific group in the Databricks account.
Get(ctx context.Context, request GetAccountGroupRequest) (*AccountGroup, error)
// Gets all details of the groups associated with the Databricks account. As
// of 08/22/2025, this endpoint will no longer return members. Instead,
// members should be retrieved by iterating through `Get group details`.
// Existing accounts that rely on this attribute will not be impacted and
// will continue receiving member data as before.
List(ctx context.Context, request ListAccountGroupsRequest) (*ListAccountGroupsResponse, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PatchAccountGroupRequest) error
// Updates the details of a group by replacing the entire group entity.
Update(ctx context.Context, request UpdateAccountGroupRequest) 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountServicePrincipal ¶ added in v0.84.0
type AccountServicePrincipal struct {
// Databricks account ID
AccountId string `json:"account_id,omitempty"`
// 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"`
ExternalId string `json:"externalId,omitempty"`
// Databricks service principal ID.
Id string `json:"id,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (AccountServicePrincipal) MarshalJSON ¶ added in v0.84.0
func (s AccountServicePrincipal) MarshalJSON() ([]byte, error)
func (*AccountServicePrincipal) UnmarshalJSON ¶ added in v0.84.0
func (s *AccountServicePrincipal) UnmarshalJSON(b []byte) error
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 ¶
func (a *AccountServicePrincipalsAPI) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
func (*AccountServicePrincipalsAPI) Delete ¶
func (a *AccountServicePrincipalsAPI) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
func (*AccountServicePrincipalsAPI) DeleteById ¶
func (a *AccountServicePrincipalsAPI) DeleteById(ctx context.Context, id string) error
Delete a single service principal in the Databricks account.
func (*AccountServicePrincipalsAPI) Get ¶
func (a *AccountServicePrincipalsAPI) Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*ServicePrincipal, error)
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 ¶
func (a *AccountServicePrincipalsAPI) GetById(ctx context.Context, id string) (*ServicePrincipal, error)
Gets the details for a single service principal define in the Databricks account.
func (*AccountServicePrincipalsAPI) List ¶ added in v0.24.0
func (a *AccountServicePrincipalsAPI) List(ctx context.Context, request ListAccountServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
Gets the set of service principals associated with a Databricks account.
func (*AccountServicePrincipalsAPI) ListAll ¶
func (a *AccountServicePrincipalsAPI) ListAll(ctx context.Context, request ListAccountServicePrincipalsRequest) ([]ServicePrincipal, error)
Gets the set of service principals associated with a Databricks account.
func (*AccountServicePrincipalsAPI) Patch ¶
func (a *AccountServicePrincipalsAPI) Patch(ctx context.Context, request PartialUpdate) error
func (*AccountServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap ¶
func (a *AccountServicePrincipalsAPI) ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListAccountServicePrincipalsRequest) (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.
type AccountServicePrincipalsInterface ¶ added in v0.29.0
type AccountServicePrincipalsInterface interface {
// Creates a new service principal in the Databricks account.
Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
// Delete a single service principal in the Databricks account.
Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
// Delete a single service principal in the Databricks account.
DeleteById(ctx context.Context, id string) error
// Gets the details for a single service principal define in the Databricks
// account.
Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*ServicePrincipal, error)
// Gets the details for a single service principal define in the Databricks
// account.
GetById(ctx context.Context, id string) (*ServicePrincipal, error)
// Gets the set of service principals associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListAccountServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
// Gets the set of service principals associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListAccountServicePrincipalsRequest) ([]ServicePrincipal, 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.
ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListAccountServicePrincipalsRequest) (map[string]string, 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.
GetByDisplayName(ctx context.Context, name string) (*ServicePrincipal, error)
// Partially updates the details of a single service principal in the Databricks
// account.
Patch(ctx context.Context, request PartialUpdate) error
// 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
}
type AccountServicePrincipalsService
deprecated
type AccountServicePrincipalsService interface {
// Creates a new service principal in the Databricks account.
Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
// Delete a single service principal in the Databricks account.
Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
// Gets the details for a single service principal define in the Databricks
// account.
Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*ServicePrincipal, error)
// Gets the set of service principals associated with a Databricks account.
List(ctx context.Context, request ListAccountServicePrincipalsRequest) (*ListServicePrincipalResponse, error)
// Partially updates the details of a single service principal in the
// Databricks account.
Patch(ctx context.Context, request PartialUpdate) error
// 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountServicePrincipalsV2API ¶ added in v0.84.0
type AccountServicePrincipalsV2API 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 NewAccountServicePrincipalsV2 ¶ added in v0.84.0
func NewAccountServicePrincipalsV2(client *client.DatabricksClient) *AccountServicePrincipalsV2API
func (*AccountServicePrincipalsV2API) Create ¶ added in v0.84.0
func (a *AccountServicePrincipalsV2API) Create(ctx context.Context, request CreateAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
func (*AccountServicePrincipalsV2API) Delete ¶ added in v0.84.0
func (a *AccountServicePrincipalsV2API) Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
func (*AccountServicePrincipalsV2API) Get ¶ added in v0.84.0
func (a *AccountServicePrincipalsV2API) Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
func (*AccountServicePrincipalsV2API) List ¶ added in v0.84.0
func (a *AccountServicePrincipalsV2API) List(ctx context.Context, request ListAccountServicePrincipalsRequest) listing.Iterator[AccountServicePrincipal]
Gets the set of service principals associated with a Databricks account.
func (*AccountServicePrincipalsV2API) ListAll ¶ added in v0.84.0
func (a *AccountServicePrincipalsV2API) ListAll(ctx context.Context, request ListAccountServicePrincipalsRequest) ([]AccountServicePrincipal, error)
Gets the set of service principals associated with a Databricks account.
type AccountServicePrincipalsV2Interface ¶ added in v0.84.0
type AccountServicePrincipalsV2Interface interface {
// Creates a new service principal in the Databricks account.
Create(ctx context.Context, request CreateAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
// Delete a single service principal in the Databricks account.
Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
// Gets the details for a single service principal define in the Databricks
// account.
Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
// Gets the set of service principals associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListAccountServicePrincipalsRequest) listing.Iterator[AccountServicePrincipal]
// Gets the set of service principals associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListAccountServicePrincipalsRequest) ([]AccountServicePrincipal, error)
// Partially updates the details of a single service principal in the Databricks
// account.
Patch(ctx context.Context, request PatchAccountServicePrincipalRequest) error
// Updates the details of a single service principal.
//
// This action replaces the existing service principal with the same name.
Update(ctx context.Context, request UpdateAccountServicePrincipalRequest) error
}
type AccountServicePrincipalsV2Service
deprecated
added in
v0.84.0
type AccountServicePrincipalsV2Service interface {
// Creates a new service principal in the Databricks account.
Create(ctx context.Context, request CreateAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
// Delete a single service principal in the Databricks account.
Delete(ctx context.Context, request DeleteAccountServicePrincipalRequest) error
// Gets the details for a single service principal define in the Databricks
// account.
Get(ctx context.Context, request GetAccountServicePrincipalRequest) (*AccountServicePrincipal, error)
// Gets the set of service principals associated with a Databricks account.
List(ctx context.Context, request ListAccountServicePrincipalsRequest) (*ListAccountServicePrincipalsResponse, error)
// Partially updates the details of a single service principal in the
// Databricks account.
Patch(ctx context.Context, request PatchAccountServicePrincipalRequest) error
// Updates the details of a single service principal.
//
// This action replaces the existing service principal with the same name.
Update(ctx context.Context, request UpdateAccountServicePrincipalRequest) 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountUser ¶ added in v0.84.0
type AccountUser struct {
// Databricks account ID
AccountId string `json:"account_id,omitempty"`
// 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"`
// External ID is not currently supported. It is reserved for future use.
ExternalId string `json:"externalId,omitempty"`
// Databricks user ID.
Id string `json:"id,omitempty"`
Name *Name `json:"name,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
// Email address of the Databricks user.
UserName string `json:"userName,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (AccountUser) MarshalJSON ¶ added in v0.84.0
func (s AccountUser) MarshalJSON() ([]byte, error)
func (*AccountUser) UnmarshalJSON ¶ added in v0.84.0
func (s *AccountUser) UnmarshalJSON(b []byte) error
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) Delete ¶
func (a *AccountUsersAPI) Delete(ctx context.Context, request DeleteAccountUserRequest) error
func (*AccountUsersAPI) DeleteById ¶
func (a *AccountUsersAPI) DeleteById(ctx context.Context, id string) error
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 GetAccountUserRequest) (*User, error)
func (*AccountUsersAPI) GetByUserName ¶
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) List ¶ added in v0.24.0
func (a *AccountUsersAPI) List(ctx context.Context, request ListAccountUsersRequest) listing.Iterator[User]
Gets details for all the users associated with a Databricks account.
func (*AccountUsersAPI) ListAll ¶
func (a *AccountUsersAPI) ListAll(ctx context.Context, request ListAccountUsersRequest) ([]User, error)
Gets details for all the users associated with a Databricks account.
func (*AccountUsersAPI) Patch ¶
func (a *AccountUsersAPI) Patch(ctx context.Context, request PartialUpdate) error
func (*AccountUsersAPI) UserUserNameToIdMap ¶
func (a *AccountUsersAPI) UserUserNameToIdMap(ctx context.Context, request ListAccountUsersRequest) (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.
type AccountUsersInterface ¶ added in v0.29.0
type AccountUsersInterface interface {
// 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)
// Deletes a user. Deleting a user from a Databricks account also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteAccountUserRequest) error
// Deletes a user. Deleting a user from a Databricks account also removes
// objects associated with the user.
DeleteById(ctx context.Context, id string) error
// Gets information for a specific user in Databricks account.
Get(ctx context.Context, request GetAccountUserRequest) (*User, error)
// Gets information for a specific user in Databricks account.
GetById(ctx context.Context, id string) (*User, error)
// Gets details for all the users associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListAccountUsersRequest) listing.Iterator[User]
// Gets details for all the users associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListAccountUsersRequest) ([]User, 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.
UserUserNameToIdMap(ctx context.Context, request ListAccountUsersRequest) (map[string]string, 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.
GetByUserName(ctx context.Context, name string) (*User, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PartialUpdate) error
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request User) error
}
type AccountUsersService
deprecated
type AccountUsersService interface {
// 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)
// Deletes a user. Deleting a user from a Databricks account also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteAccountUserRequest) error
// Gets information for a specific user in Databricks account.
Get(ctx context.Context, request GetAccountUserRequest) (*User, error)
// Gets details for all the users associated with a Databricks account.
List(ctx context.Context, request ListAccountUsersRequest) (*ListUsersResponse, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PartialUpdate) error
// 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type AccountUsersV2API ¶ added in v0.84.0
type AccountUsersV2API 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 NewAccountUsersV2 ¶ added in v0.84.0
func NewAccountUsersV2(client *client.DatabricksClient) *AccountUsersV2API
func (*AccountUsersV2API) Create ¶ added in v0.84.0
func (a *AccountUsersV2API) Create(ctx context.Context, request CreateAccountUserRequest) (*AccountUser, error)
func (*AccountUsersV2API) Delete ¶ added in v0.84.0
func (a *AccountUsersV2API) Delete(ctx context.Context, request DeleteAccountUserRequest) error
func (*AccountUsersV2API) Get ¶ added in v0.84.0
func (a *AccountUsersV2API) Get(ctx context.Context, request GetAccountUserRequest) (*AccountUser, error)
func (*AccountUsersV2API) List ¶ added in v0.84.0
func (a *AccountUsersV2API) List(ctx context.Context, request ListAccountUsersRequest) listing.Iterator[AccountUser]
Gets details for all the users associated with a Databricks account.
func (*AccountUsersV2API) ListAll ¶ added in v0.84.0
func (a *AccountUsersV2API) ListAll(ctx context.Context, request ListAccountUsersRequest) ([]AccountUser, error)
Gets details for all the users associated with a Databricks account.
type AccountUsersV2Interface ¶ added in v0.84.0
type AccountUsersV2Interface interface {
// Creates a new user in the Databricks account. This new user will also be
// added to the Databricks account.
Create(ctx context.Context, request CreateAccountUserRequest) (*AccountUser, error)
// Deletes a user. Deleting a user from a Databricks account also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteAccountUserRequest) error
// Gets information for a specific user in Databricks account.
Get(ctx context.Context, request GetAccountUserRequest) (*AccountUser, error)
// Gets details for all the users associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListAccountUsersRequest) listing.Iterator[AccountUser]
// Gets details for all the users associated with a Databricks account.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListAccountUsersRequest) ([]AccountUser, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PatchAccountUserRequest) error
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request UpdateAccountUserRequest) error
}
type AccountUsersV2Service
deprecated
added in
v0.84.0
type AccountUsersV2Service interface {
// Creates a new user in the Databricks account. This new user will also be
// added to the Databricks account.
Create(ctx context.Context, request CreateAccountUserRequest) (*AccountUser, error)
// Deletes a user. Deleting a user from a Databricks account also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteAccountUserRequest) error
// Gets information for a specific user in Databricks account.
Get(ctx context.Context, request GetAccountUserRequest) (*AccountUser, error)
// Gets details for all the users associated with a Databricks account.
List(ctx context.Context, request ListAccountUsersRequest) (*ListAccountUsersResponse, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PatchAccountUserRequest) error
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request UpdateAccountUserRequest) 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type Actor ¶ added in v0.56.0
type Actor struct {
ActorId int64 `json:"actor_id,omitempty" url:"actor_id,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
represents an identity trying to access a resource - user or a service principal group can be a principal of a permission set assignment but an actor is always a user or a service principal
func (Actor) MarshalJSON ¶ added in v0.56.0
func (*Actor) UnmarshalJSON ¶ added in v0.56.0
type CheckPolicyRequest ¶ added in v0.56.0
type CheckPolicyRequest struct {
Actor Actor `json:"-" url:"actor"`
AuthzIdentity RequestAuthzIdentity `json:"-" url:"authz_identity"`
ConsistencyToken ConsistencyToken `json:"-" url:"consistency_token"`
Permission string `json:"-" url:"permission"`
// Ex: (servicePrincipal/use,
// accounts/<account-id>/servicePrincipals/<sp-id>) Ex:
// (servicePrincipal.ruleSet/update,
// accounts/<account-id>/servicePrincipals/<sp-id>/ruleSets/default)
Resource string `json:"-" url:"resource"`
ResourceInfo *ResourceInfo `json:"-" url:"resource_info,omitempty"`
}
type CheckPolicyResponse ¶ added in v0.56.0
type CheckPolicyResponse struct {
ConsistencyToken ConsistencyToken `json:"consistency_token"`
IsPermitted bool `json:"is_permitted,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CheckPolicyResponse) MarshalJSON ¶ added in v0.56.0
func (s CheckPolicyResponse) MarshalJSON() ([]byte, error)
func (*CheckPolicyResponse) UnmarshalJSON ¶ added in v0.56.0
func (s *CheckPolicyResponse) UnmarshalJSON(b []byte) error
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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ComplexValue) MarshalJSON ¶ added in v0.23.0
func (s ComplexValue) MarshalJSON() ([]byte, error)
func (*ComplexValue) UnmarshalJSON ¶ added in v0.23.0
func (s *ComplexValue) UnmarshalJSON(b []byte) error
type ConsistencyToken ¶ added in v0.56.0
type ConsistencyToken struct {
Value string `json:"value" url:"value"`
}
type CreateAccountGroupRequest ¶ added in v0.84.0
type CreateAccountGroupRequest struct {
// String that represents a human-readable group name
DisplayName string `json:"displayName,omitempty"`
ExternalId string `json:"externalId,omitempty"`
// Databricks group ID
Id string `json:"id,omitempty"`
Members []ComplexValue `json:"members,omitempty"`
// Container for the group identifier. Workspace local versus account.
Meta *ResourceMeta `json:"meta,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateAccountGroupRequest) MarshalJSON ¶ added in v0.84.0
func (s CreateAccountGroupRequest) MarshalJSON() ([]byte, error)
func (*CreateAccountGroupRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *CreateAccountGroupRequest) UnmarshalJSON(b []byte) error
type CreateAccountServicePrincipalRequest ¶ added in v0.84.0
type CreateAccountServicePrincipalRequest 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"`
ExternalId string `json:"externalId,omitempty"`
// Databricks service principal ID.
Id string `json:"id,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateAccountServicePrincipalRequest) MarshalJSON ¶ added in v0.84.0
func (s CreateAccountServicePrincipalRequest) MarshalJSON() ([]byte, error)
func (*CreateAccountServicePrincipalRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *CreateAccountServicePrincipalRequest) UnmarshalJSON(b []byte) error
type CreateAccountUserRequest ¶ added in v0.84.0
type CreateAccountUserRequest 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"`
// External ID is not currently supported. It is reserved for future use.
ExternalId string `json:"externalId,omitempty"`
// Databricks user ID.
Id string `json:"id,omitempty"`
Name *Name `json:"name,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
// Email address of the Databricks user.
UserName string `json:"userName,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateAccountUserRequest) MarshalJSON ¶ added in v0.84.0
func (s CreateAccountUserRequest) MarshalJSON() ([]byte, error)
func (*CreateAccountUserRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *CreateAccountUserRequest) UnmarshalJSON(b []byte) error
type CreateGroupRequest ¶ added in v0.84.0
type CreateGroupRequest struct {
// String that represents a human-readable group name
DisplayName string `json:"displayName,omitempty"`
// Entitlements assigned to the group. See [assigning entitlements] for a
// full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks group ID
Id string `json:"id,omitempty"`
Members []ComplexValue `json:"members,omitempty"`
// Container for the group identifier. Workspace local versus account.
Meta *ResourceMeta `json:"meta,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the group.
Schemas []GroupSchema `json:"schemas,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateGroupRequest) MarshalJSON ¶ added in v0.84.0
func (s CreateGroupRequest) MarshalJSON() ([]byte, error)
func (*CreateGroupRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *CreateGroupRequest) UnmarshalJSON(b []byte) error
type CreateServicePrincipalRequest ¶ added in v0.84.0
type CreateServicePrincipalRequest 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 assigned to the service principal. See [assigning
// entitlements] for a full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks service principal ID.
Id string `json:"id,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the List response.
Schemas []ServicePrincipalSchema `json:"schemas,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateServicePrincipalRequest) MarshalJSON ¶ added in v0.84.0
func (s CreateServicePrincipalRequest) MarshalJSON() ([]byte, error)
func (*CreateServicePrincipalRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *CreateServicePrincipalRequest) UnmarshalJSON(b []byte) error
type CreateUserRequest ¶ added in v0.84.0
type CreateUserRequest 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`. This field cannot be updated through the Workspace
// SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to
// update `displayName`.
//
// [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation
DisplayName string `json:"displayName,omitempty"`
// All the emails associated with the Databricks user.
Emails []ComplexValue `json:"emails,omitempty"`
// Entitlements assigned to the user. See [assigning entitlements] for a
// full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
// External ID is not currently supported. It is reserved for future use.
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks user ID.
Id string `json:"id,omitempty"`
Name *Name `json:"name,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the user.
Schemas []UserSchema `json:"schemas,omitempty"`
// Email address of the Databricks user.
UserName string `json:"userName,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (CreateUserRequest) MarshalJSON ¶ added in v0.84.0
func (s CreateUserRequest) MarshalJSON() ([]byte, error)
func (*CreateUserRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *CreateUserRequest) UnmarshalJSON(b []byte) error
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) Me ¶
Example (CurrentUser) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", me)
Example (Tokens) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
me2, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", me2)
type CurrentUserInterface ¶ added in v0.29.0
type CurrentUserService
deprecated
type CurrentUserService interface {
// 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type DeleteAccountGroupRequest ¶
type DeleteAccountGroupRequest struct {
// Unique ID for a group in the Databricks account.
Id string `json:"-" url:"-"`
}
type DeleteAccountServicePrincipalRequest ¶
type DeleteAccountServicePrincipalRequest struct {
// Unique ID for a service principal in the Databricks account.
Id string `json:"-" url:"-"`
}
type DeleteAccountUserRequest ¶
type DeleteAccountUserRequest struct {
// Unique ID for a user in the Databricks account.
Id string `json:"-" url:"-"`
}
type DeleteGroupRequest ¶
type DeleteGroupRequest struct {
// Unique ID for a group in the Databricks workspace.
Id string `json:"-" url:"-"`
}
type DeleteServicePrincipalRequest ¶
type DeleteServicePrincipalRequest struct {
// Unique ID for a service principal in the Databricks workspace.
Id string `json:"-" url:"-"`
}
type DeleteUserRequest ¶
type DeleteUserRequest struct {
// Unique ID for a user in the Databricks workspace.
Id string `json:"-" url:"-"`
}
type GetAccountGroupRequest ¶
type GetAccountGroupRequest struct {
// Unique ID for a group in the Databricks account.
Id string `json:"-" url:"-"`
}
type GetAccountServicePrincipalRequest ¶
type GetAccountServicePrincipalRequest struct {
// Unique ID for a service principal in the Databricks account.
Id string `json:"-" url:"-"`
}
type GetAccountUserRequest ¶
type GetAccountUserRequest struct {
// Comma-separated list of attributes to return in response.
Attributes string `json:"-" url:"attributes,omitempty"`
// Desired number of results per page. Default is 10000.
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"`
// Unique ID for a user in the Databricks account.
Id string `json:"-" url:"-"`
// 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 GetSortOrder `json:"-" url:"sortOrder,omitempty"`
// Specifies the index of the first result. First item is number 1.
StartIndex int `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (GetAccountUserRequest) MarshalJSON ¶ added in v0.24.0
func (s GetAccountUserRequest) MarshalJSON() ([]byte, error)
func (*GetAccountUserRequest) UnmarshalJSON ¶ added in v0.24.0
func (s *GetAccountUserRequest) UnmarshalJSON(b []byte) error
type GetAssignableRolesForResourceRequest ¶ added in v0.10.0
type GetAssignableRolesForResourceRequest struct {
// The resource name for which assignable roles will be listed.
//
// Examples | Summary :--- | :--- `resource=accounts/<ACCOUNT_ID>` | A
// resource name for the account.
// `resource=accounts/<ACCOUNT_ID>/groups/<GROUP_ID>` | A resource name for
// the group. `resource=accounts/<ACCOUNT_ID>/servicePrincipals/<SP_ID>` | A
// resource name for the service principal.
// `resource=accounts/<ACCOUNT_ID>/tagPolicies/<TAG_POLICY_ID>` | A resource
// name for the tag policy.
Resource string `json:"-" url:"resource"`
}
type GetAssignableRolesForResourceResponse ¶ added in v0.10.0
type GetAssignableRolesForResourceResponse struct {
Roles []Role `json:"roles,omitempty"`
}
type GetGroupRequest ¶
type GetGroupRequest struct {
// Unique ID for a group in the Databricks workspace.
Id string `json:"-" url:"-"`
}
type GetPasswordPermissionLevelsRequest ¶ added in v0.84.0
type GetPasswordPermissionLevelsRequest struct {
}
type GetPasswordPermissionLevelsResponse ¶ added in v0.15.0
type GetPasswordPermissionLevelsResponse struct {
// Specific permission levels
PermissionLevels []PasswordPermissionsDescription `json:"permission_levels,omitempty"`
}
type GetPasswordPermissionsRequest ¶ added in v0.84.0
type GetPasswordPermissionsRequest struct {
}
type GetPermissionLevelsRequest ¶
type GetPermissionLevelsRequest struct {
RequestObjectId string `json:"-" url:"-"`
// The type of the request object. Can be one of the following: alerts,
// alertsv2, authorization, clusters, cluster-policies, dashboards,
// dbsql-dashboards, directories, experiments, files, genie, instance-pools,
// jobs, notebooks, pipelines, queries, registered-models, repos,
// serving-endpoints, or warehouses.
RequestObjectType string `json:"-" url:"-"`
}
type GetPermissionLevelsResponse ¶
type GetPermissionLevelsResponse struct {
// Specific permission levels
PermissionLevels []PermissionsDescription `json:"permission_levels,omitempty"`
}
type GetPermissionRequest ¶
type GetPermissionRequest struct {
// The id of the request object.
RequestObjectId string `json:"-" url:"-"`
// The type of the request object. Can be one of the following: alerts,
// alertsv2, authorization, clusters, cluster-policies, dashboards,
// dbsql-dashboards, directories, experiments, files, genie, instance-pools,
// jobs, notebooks, pipelines, queries, registered-models, repos,
// serving-endpoints, or warehouses.
RequestObjectType string `json:"-" url:"-"`
}
type GetRuleSetRequest ¶ added in v0.10.0
type GetRuleSetRequest struct {
// Etag used for versioning. The response is at least as fresh as the eTag
// provided. Etag is used for optimistic concurrency control as a way to
// help prevent simultaneous updates of a rule set from overwriting each
// other. It is strongly suggested that systems make use of the etag in the
// read -> modify -> write pattern to perform rule set updates in order to
// avoid race conditions that is get an etag from a GET rule set request,
// and pass it with the PUT update request to identify the rule set version
// you are updating.
//
// Examples | Summary :--- | :--- `etag=` | An empty etag can only be used
// in GET to indicate no freshness requirements.
// `etag=RENUAAABhSweA4NvVmmUYdiU717H3Tgy0UJdor3gE4a+mq/oj9NjAf8ZsQ==` | An
// etag encoded a specific version of the rule set to get or to be updated.
Etag string `json:"-" url:"etag"`
// The ruleset name associated with the request.
//
// Examples | Summary :--- | :---
// `name=accounts/<ACCOUNT_ID>/ruleSets/default` | A name for a rule set on
// the account.
// `name=accounts/<ACCOUNT_ID>/groups/<GROUP_ID>/ruleSets/default` | A name
// for a rule set on the group.
// `name=accounts/<ACCOUNT_ID>/servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>/ruleSets/default`
// | A name for a rule set on the service principal.
// `name=accounts/<ACCOUNT_ID>/tagPolicies/<TAG_POLICY_ID>/ruleSets/default`
// | A name for a rule set on the tag policy.
Name string `json:"-" url:"name"`
}
type GetServicePrincipalRequest ¶
type GetServicePrincipalRequest struct {
// Unique ID for a service principal in the Databricks workspace.
Id string `json:"-" url:"-"`
}
type GetSortOrder ¶ added in v0.24.0
type GetSortOrder string
const GetSortOrderAscending GetSortOrder = `ascending`
const GetSortOrderDescending GetSortOrder = `descending`
func (*GetSortOrder) Set ¶ added in v0.24.0
func (f *GetSortOrder) Set(v string) error
Set raw string value and validate it against allowed values
func (*GetSortOrder) String ¶ added in v0.24.0
func (f *GetSortOrder) String() string
String representation for fmt.Print
func (*GetSortOrder) Type ¶ added in v0.24.0
func (f *GetSortOrder) Type() string
Type always returns GetSortOrder to satisfy [pflag.Value] interface
func (*GetSortOrder) Values ¶ added in v0.72.0
func (f *GetSortOrder) Values() []GetSortOrder
Values returns all possible values for GetSortOrder.
There is no guarantee on the order of the values in the slice.
type GetUserRequest ¶
type GetUserRequest 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"`
// Unique ID for a user in the Databricks workspace.
Id string `json:"-" url:"-"`
// 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 GetSortOrder `json:"-" url:"sortOrder,omitempty"`
// Specifies the index of the first result. First item is number 1.
StartIndex int `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (GetUserRequest) MarshalJSON ¶ added in v0.24.0
func (s GetUserRequest) MarshalJSON() ([]byte, error)
func (*GetUserRequest) UnmarshalJSON ¶ added in v0.24.0
func (s *GetUserRequest) UnmarshalJSON(b []byte) error
type GetWorkspaceAssignmentRequest ¶
type GetWorkspaceAssignmentRequest struct {
// The workspace ID.
WorkspaceId int64 `json:"-" url:"-"`
}
type GrantRule ¶ added in v0.10.0
type GrantRule struct {
// Principals this grant rule applies to. A principal can be a user (for end
// users), a service principal (for applications and compute workloads), or
// an account group. Each principal has its own identifier format: *
// users/<USERNAME> * groups/<GROUP_NAME> *
// servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>
Principals []string `json:"principals,omitempty"`
// Role that is assigned to the list of principals.
Role string `json:"role"`
}
type Group ¶
type Group struct {
// String that represents a human-readable group name
DisplayName string `json:"displayName,omitempty"`
// Entitlements assigned to the group. See [assigning entitlements] for a
// full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
// external_id should be unique for identifying groups
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks group ID
Id string `json:"id,omitempty"`
Members []ComplexValue `json:"members,omitempty"`
// Container for the group identifier. Workspace local versus account.
Meta *ResourceMeta `json:"meta,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the group.
Schemas []GroupSchema `json:"schemas,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (Group) MarshalJSON ¶ added in v0.23.0
func (*Group) UnmarshalJSON ¶ added in v0.23.0
type GroupSchema ¶ added in v0.24.0
type GroupSchema string
const GroupSchemaUrnIetfParamsScimSchemasCore20Group GroupSchema = `urn:ietf:params:scim:schemas:core:2.0:Group`
func (*GroupSchema) Set ¶ added in v0.24.0
func (f *GroupSchema) Set(v string) error
Set raw string value and validate it against allowed values
func (*GroupSchema) String ¶ added in v0.24.0
func (f *GroupSchema) String() string
String representation for fmt.Print
func (*GroupSchema) Type ¶ added in v0.24.0
func (f *GroupSchema) Type() string
Type always returns GroupSchema to satisfy [pflag.Value] interface
func (*GroupSchema) Values ¶ added in v0.72.0
func (f *GroupSchema) Values() []GroupSchema
Values returns all possible values for GroupSchema.
There is no guarantee on the order of the values in the slice.
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 ¶
Example (GenericPermissions) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
// cleanup
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
Example (Groups) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
// cleanup
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
Example (Secrets) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
// cleanup
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
func (*GroupsAPI) Delete ¶
func (a *GroupsAPI) Delete(ctx context.Context, request DeleteGroupRequest) error
Example (GenericPermissions) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
Example (Groups) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
// cleanup
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
Example (Secrets) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
func (*GroupsAPI) DeleteById ¶
Deletes a group from the Databricks workspace.
func (*GroupsAPI) Get ¶
func (a *GroupsAPI) Get(ctx context.Context, request GetGroupRequest) (*Group, error)
Example (Groups) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
fetch, err := w.Groups.GetById(ctx, group.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", fetch)
// cleanup
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
func (*GroupsAPI) GetByDisplayName ¶
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) 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) List ¶ added in v0.24.0
Gets all details of the groups associated with the Databricks workspace.
func (*GroupsAPI) ListAll ¶
func (a *GroupsAPI) ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)
Gets all details of the groups associated with the Databricks workspace.
type GroupsInterface ¶ added in v0.29.0
type GroupsInterface interface {
// Creates a group in the Databricks workspace with a unique name, using the
// supplied group details.
Create(ctx context.Context, request Group) (*Group, error)
// Deletes a group from the Databricks workspace.
Delete(ctx context.Context, request DeleteGroupRequest) error
// Deletes a group from the Databricks workspace.
DeleteById(ctx context.Context, id string) error
// Gets the information for a specific group in the Databricks workspace.
Get(ctx context.Context, request GetGroupRequest) (*Group, error)
// Gets the information for a specific group in the Databricks workspace.
GetById(ctx context.Context, id string) (*Group, error)
// Gets all details of the groups associated with the Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListGroupsRequest) listing.Iterator[Group]
// Gets all details of the groups associated with the Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, 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.
GroupDisplayNameToIdMap(ctx context.Context, request ListGroupsRequest) (map[string]string, 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.
GetByDisplayName(ctx context.Context, name string) (*Group, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PartialUpdate) error
// Updates the details of a group by replacing the entire group entity.
Update(ctx context.Context, request Group) error
}
type GroupsService
deprecated
type GroupsService interface {
// Creates a group in the Databricks workspace with a unique name, using the
// supplied group details.
Create(ctx context.Context, request Group) (*Group, error)
// Deletes a group from the Databricks workspace.
Delete(ctx context.Context, request DeleteGroupRequest) error
// Gets the information for a specific group in the Databricks workspace.
Get(ctx context.Context, request GetGroupRequest) (*Group, error)
// Gets all details of the groups associated with the Databricks workspace.
List(ctx context.Context, request ListGroupsRequest) (*ListGroupsResponse, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PartialUpdate) error
// 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type GroupsV2API ¶ added in v0.84.0
type GroupsV2API 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 NewGroupsV2 ¶ added in v0.84.0
func NewGroupsV2(client *client.DatabricksClient) *GroupsV2API
func (*GroupsV2API) Create ¶ added in v0.84.0
func (a *GroupsV2API) Create(ctx context.Context, request CreateGroupRequest) (*Group, error)
func (*GroupsV2API) Delete ¶ added in v0.84.0
func (a *GroupsV2API) Delete(ctx context.Context, request DeleteGroupRequest) error
func (*GroupsV2API) Get ¶ added in v0.84.0
func (a *GroupsV2API) Get(ctx context.Context, request GetGroupRequest) (*Group, error)
func (*GroupsV2API) List ¶ added in v0.84.0
Gets all details of the groups associated with the Databricks workspace.
func (*GroupsV2API) ListAll ¶ added in v0.84.0
func (a *GroupsV2API) ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)
Gets all details of the groups associated with the Databricks workspace.
type GroupsV2Interface ¶ added in v0.84.0
type GroupsV2Interface interface {
// Creates a group in the Databricks workspace with a unique name, using the
// supplied group details.
Create(ctx context.Context, request CreateGroupRequest) (*Group, error)
// Deletes a group from the Databricks workspace.
Delete(ctx context.Context, request DeleteGroupRequest) error
// Gets the information for a specific group in the Databricks workspace.
Get(ctx context.Context, request GetGroupRequest) (*Group, error)
// Gets all details of the groups associated with the Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListGroupsRequest) listing.Iterator[Group]
// Gets all details of the groups associated with the Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListGroupsRequest) ([]Group, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PatchGroupRequest) error
// Updates the details of a group by replacing the entire group entity.
Update(ctx context.Context, request UpdateGroupRequest) error
}
type GroupsV2Service
deprecated
added in
v0.84.0
type GroupsV2Service interface {
// Creates a group in the Databricks workspace with a unique name, using the
// supplied group details.
Create(ctx context.Context, request CreateGroupRequest) (*Group, error)
// Deletes a group from the Databricks workspace.
Delete(ctx context.Context, request DeleteGroupRequest) error
// Gets the information for a specific group in the Databricks workspace.
Get(ctx context.Context, request GetGroupRequest) (*Group, error)
// Gets all details of the groups associated with the Databricks workspace.
List(ctx context.Context, request ListGroupsRequest) (*ListGroupsResponse, error)
// Partially updates the details of a group.
Patch(ctx context.Context, request PatchGroupRequest) error
// Updates the details of a group by replacing the entire group entity.
Update(ctx context.Context, request UpdateGroupRequest) 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type ListAccountGroupsRequest ¶
type ListAccountGroupsRequest struct {
// Comma-separated list of attributes to return in response.
Attributes string `json:"-" url:"attributes,omitempty"`
// Desired number of results per page. Default is 10000.
Count int64 `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 int64 `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListAccountGroupsRequest) MarshalJSON ¶ added in v0.23.0
func (s ListAccountGroupsRequest) MarshalJSON() ([]byte, error)
func (*ListAccountGroupsRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListAccountGroupsRequest) UnmarshalJSON(b []byte) error
type ListAccountGroupsResponse ¶ added in v0.84.0
type ListAccountGroupsResponse struct {
// Total results returned in the response.
ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
// User objects returned in the response.
Resources []AccountGroup `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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListAccountGroupsResponse) MarshalJSON ¶ added in v0.84.0
func (s ListAccountGroupsResponse) MarshalJSON() ([]byte, error)
func (*ListAccountGroupsResponse) UnmarshalJSON ¶ added in v0.84.0
func (s *ListAccountGroupsResponse) UnmarshalJSON(b []byte) error
type ListAccountServicePrincipalsRequest ¶
type ListAccountServicePrincipalsRequest struct {
// Comma-separated list of attributes to return in response.
Attributes string `json:"-" url:"attributes,omitempty"`
// Desired number of results per page. Default is 10000.
Count int64 `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 int64 `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListAccountServicePrincipalsRequest) MarshalJSON ¶ added in v0.23.0
func (s ListAccountServicePrincipalsRequest) MarshalJSON() ([]byte, error)
func (*ListAccountServicePrincipalsRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListAccountServicePrincipalsRequest) UnmarshalJSON(b []byte) error
type ListAccountServicePrincipalsResponse ¶ added in v0.84.0
type ListAccountServicePrincipalsResponse struct {
// Total results returned in the response.
ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
// User objects returned in the response.
Resources []AccountServicePrincipal `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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListAccountServicePrincipalsResponse) MarshalJSON ¶ added in v0.84.0
func (s ListAccountServicePrincipalsResponse) MarshalJSON() ([]byte, error)
func (*ListAccountServicePrincipalsResponse) UnmarshalJSON ¶ added in v0.84.0
func (s *ListAccountServicePrincipalsResponse) UnmarshalJSON(b []byte) error
type ListAccountUsersRequest ¶
type ListAccountUsersRequest struct {
// Comma-separated list of attributes to return in response.
Attributes string `json:"-" url:"attributes,omitempty"`
// Desired number of results per page. Default is 10000.
Count int64 `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 int64 `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListAccountUsersRequest) MarshalJSON ¶ added in v0.23.0
func (s ListAccountUsersRequest) MarshalJSON() ([]byte, error)
func (*ListAccountUsersRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListAccountUsersRequest) UnmarshalJSON(b []byte) error
type ListAccountUsersResponse ¶ added in v0.84.0
type ListAccountUsersResponse struct {
// Total results returned in the response.
ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
// User objects returned in the response.
Resources []AccountUser `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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListAccountUsersResponse) MarshalJSON ¶ added in v0.84.0
func (s ListAccountUsersResponse) MarshalJSON() ([]byte, error)
func (*ListAccountUsersResponse) UnmarshalJSON ¶ added in v0.84.0
func (s *ListAccountUsersResponse) UnmarshalJSON(b []byte) error
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 int64 `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 int64 `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListGroupsRequest) MarshalJSON ¶ added in v0.23.0
func (s ListGroupsRequest) MarshalJSON() ([]byte, error)
func (*ListGroupsRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListGroupsRequest) UnmarshalJSON(b []byte) error
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"`
// The schema of the service principal.
Schemas []ListResponseSchema `json:"schemas,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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListGroupsResponse) MarshalJSON ¶ added in v0.23.0
func (s ListGroupsResponse) MarshalJSON() ([]byte, error)
func (*ListGroupsResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *ListGroupsResponse) UnmarshalJSON(b []byte) error
type ListResponseSchema ¶ added in v0.24.0
type ListResponseSchema string
const ListResponseSchemaUrnIetfParamsScimApiMessages20ListResponse ListResponseSchema = `urn:ietf:params:scim:api:messages:2.0:ListResponse`
func (*ListResponseSchema) Set ¶ added in v0.24.0
func (f *ListResponseSchema) Set(v string) error
Set raw string value and validate it against allowed values
func (*ListResponseSchema) String ¶ added in v0.24.0
func (f *ListResponseSchema) String() string
String representation for fmt.Print
func (*ListResponseSchema) Type ¶ added in v0.24.0
func (f *ListResponseSchema) Type() string
Type always returns ListResponseSchema to satisfy [pflag.Value] interface
func (*ListResponseSchema) Values ¶ added in v0.72.0
func (f *ListResponseSchema) Values() []ListResponseSchema
Values returns all possible values for ListResponseSchema.
There is no guarantee on the order of the values in the slice.
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"`
// The schema of the List response.
Schemas []ListResponseSchema `json:"schemas,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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListServicePrincipalResponse) MarshalJSON ¶ added in v0.23.0
func (s ListServicePrincipalResponse) MarshalJSON() ([]byte, error)
func (*ListServicePrincipalResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *ListServicePrincipalResponse) UnmarshalJSON(b []byte) error
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 int64 `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 int64 `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListServicePrincipalsRequest) MarshalJSON ¶ added in v0.23.0
func (s ListServicePrincipalsRequest) MarshalJSON() ([]byte, error)
func (*ListServicePrincipalsRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListServicePrincipalsRequest) UnmarshalJSON(b []byte) error
type ListSortOrder ¶
type ListSortOrder string
const ListSortOrderAscending ListSortOrder = `ascending`
const ListSortOrderDescending ListSortOrder = `descending`
func (*ListSortOrder) Set ¶
func (f *ListSortOrder) Set(v string) error
Set raw string value and validate it against allowed values
func (*ListSortOrder) String ¶
func (f *ListSortOrder) String() string
String representation for fmt.Print
func (*ListSortOrder) Type ¶
func (f *ListSortOrder) Type() string
Type always returns ListSortOrder to satisfy [pflag.Value] interface
func (*ListSortOrder) Values ¶ added in v0.72.0
func (f *ListSortOrder) Values() []ListSortOrder
Values returns all possible values for ListSortOrder.
There is no guarantee on the order of the values in the slice.
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 int64 `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 int64 `json:"-" url:"startIndex,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListUsersRequest) MarshalJSON ¶ added in v0.23.0
func (s ListUsersRequest) MarshalJSON() ([]byte, error)
func (*ListUsersRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *ListUsersRequest) UnmarshalJSON(b []byte) error
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"`
// The schema of the List response.
Schemas []ListResponseSchema `json:"schemas,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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ListUsersResponse) MarshalJSON ¶ added in v0.23.0
func (s ListUsersResponse) MarshalJSON() ([]byte, error)
func (*ListUsersResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *ListUsersResponse) UnmarshalJSON(b []byte) error
type ListWorkspaceAssignmentRequest ¶
type ListWorkspaceAssignmentRequest struct {
// The workspace ID for the account.
WorkspaceId int64 `json:"-" url:"-"`
}
type MigratePermissionsRequest ¶ added in v0.44.0
type MigratePermissionsRequest struct {
// The name of the workspace group that permissions will be migrated from.
FromWorkspaceGroupName string `json:"from_workspace_group_name"`
// The maximum number of permissions that will be migrated.
Size int `json:"size,omitempty"`
// The name of the account group that permissions will be migrated to.
ToAccountGroupName string `json:"to_account_group_name"`
// WorkspaceId of the associated workspace where the permission migration
// will occur.
WorkspaceId int64 `json:"workspace_id"`
ForceSendFields []string `json:"-" url:"-"`
}
func (MigratePermissionsRequest) MarshalJSON ¶ added in v0.44.0
func (s MigratePermissionsRequest) MarshalJSON() ([]byte, error)
func (*MigratePermissionsRequest) UnmarshalJSON ¶ added in v0.44.0
func (s *MigratePermissionsRequest) UnmarshalJSON(b []byte) error
type MigratePermissionsResponse ¶ added in v0.44.0
type MigratePermissionsResponse struct {
// Number of permissions migrated.
PermissionsMigrated int `json:"permissions_migrated,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (MigratePermissionsResponse) MarshalJSON ¶ added in v0.44.0
func (s MigratePermissionsResponse) MarshalJSON() ([]byte, error)
func (*MigratePermissionsResponse) UnmarshalJSON ¶ added in v0.44.0
func (s *MigratePermissionsResponse) UnmarshalJSON(b []byte) error
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"`
ForceSendFields []string `json:"-" url:"-"`
}
func (Name) MarshalJSON ¶ added in v0.23.0
func (*Name) UnmarshalJSON ¶ added in v0.23.0
type ObjectPermissions ¶
type ObjectPermissions struct {
AccessControlList []AccessControlResponse `json:"access_control_list,omitempty"`
ObjectId string `json:"object_id,omitempty"`
ObjectType string `json:"object_type,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ObjectPermissions) MarshalJSON ¶ added in v0.23.0
func (s ObjectPermissions) MarshalJSON() ([]byte, error)
func (*ObjectPermissions) UnmarshalJSON ¶ added in v0.23.0
func (s *ObjectPermissions) UnmarshalJSON(b []byte) error
type PartialUpdate ¶
type PartialUpdate struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type PasswordAccessControlRequest ¶ added in v0.15.0
type PasswordAccessControlRequest struct {
// name of the group
GroupName string `json:"group_name,omitempty"`
// Permission level
PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"`
// application ID of a service principal
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PasswordAccessControlRequest) MarshalJSON ¶ added in v0.23.0
func (s PasswordAccessControlRequest) MarshalJSON() ([]byte, error)
func (*PasswordAccessControlRequest) UnmarshalJSON ¶ added in v0.23.0
func (s *PasswordAccessControlRequest) UnmarshalJSON(b []byte) error
type PasswordAccessControlResponse ¶ added in v0.15.0
type PasswordAccessControlResponse struct {
// All permissions.
AllPermissions []PasswordPermission `json:"all_permissions,omitempty"`
// Display name of the user or service principal.
DisplayName string `json:"display_name,omitempty"`
// name of the group
GroupName string `json:"group_name,omitempty"`
// Name of the service principal.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PasswordAccessControlResponse) MarshalJSON ¶ added in v0.23.0
func (s PasswordAccessControlResponse) MarshalJSON() ([]byte, error)
func (*PasswordAccessControlResponse) UnmarshalJSON ¶ added in v0.23.0
func (s *PasswordAccessControlResponse) UnmarshalJSON(b []byte) error
type PasswordPermission ¶ added in v0.15.0
type PasswordPermission struct {
Inherited bool `json:"inherited,omitempty"`
InheritedFromObject []string `json:"inherited_from_object,omitempty"`
// Permission level
PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PasswordPermission) MarshalJSON ¶ added in v0.23.0
func (s PasswordPermission) MarshalJSON() ([]byte, error)
func (*PasswordPermission) UnmarshalJSON ¶ added in v0.23.0
func (s *PasswordPermission) UnmarshalJSON(b []byte) error
type PasswordPermissionLevel ¶ added in v0.15.0
type PasswordPermissionLevel string
Permission level
const PasswordPermissionLevelCanUse PasswordPermissionLevel = `CAN_USE`
func (*PasswordPermissionLevel) Set ¶ added in v0.15.0
func (f *PasswordPermissionLevel) Set(v string) error
Set raw string value and validate it against allowed values
func (*PasswordPermissionLevel) String ¶ added in v0.15.0
func (f *PasswordPermissionLevel) String() string
String representation for fmt.Print
func (*PasswordPermissionLevel) Type ¶ added in v0.15.0
func (f *PasswordPermissionLevel) Type() string
Type always returns PasswordPermissionLevel to satisfy [pflag.Value] interface
func (*PasswordPermissionLevel) Values ¶ added in v0.72.0
func (f *PasswordPermissionLevel) Values() []PasswordPermissionLevel
Values returns all possible values for PasswordPermissionLevel.
There is no guarantee on the order of the values in the slice.
type PasswordPermissions ¶ added in v0.15.0
type PasswordPermissions struct {
AccessControlList []PasswordAccessControlResponse `json:"access_control_list,omitempty"`
ObjectId string `json:"object_id,omitempty"`
ObjectType string `json:"object_type,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PasswordPermissions) MarshalJSON ¶ added in v0.23.0
func (s PasswordPermissions) MarshalJSON() ([]byte, error)
func (*PasswordPermissions) UnmarshalJSON ¶ added in v0.23.0
func (s *PasswordPermissions) UnmarshalJSON(b []byte) error
type PasswordPermissionsDescription ¶ added in v0.15.0
type PasswordPermissionsDescription struct {
Description string `json:"description,omitempty"`
// Permission level
PermissionLevel PasswordPermissionLevel `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PasswordPermissionsDescription) MarshalJSON ¶ added in v0.23.0
func (s PasswordPermissionsDescription) MarshalJSON() ([]byte, error)
func (*PasswordPermissionsDescription) UnmarshalJSON ¶ added in v0.23.0
func (s *PasswordPermissionsDescription) UnmarshalJSON(b []byte) error
type PasswordPermissionsRequest ¶ added in v0.15.0
type PasswordPermissionsRequest struct {
AccessControlList []PasswordAccessControlRequest `json:"access_control_list,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 any `json:"value,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (Patch) MarshalJSON ¶ added in v0.23.0
func (*Patch) UnmarshalJSON ¶ added in v0.23.0
type PatchAccountGroupRequest ¶ added in v0.84.0
type PatchAccountGroupRequest struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type PatchAccountServicePrincipalRequest ¶ added in v0.84.0
type PatchAccountServicePrincipalRequest struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type PatchAccountUserRequest ¶ added in v0.84.0
type PatchAccountUserRequest struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type PatchGroupRequest ¶ added in v0.84.0
type PatchGroupRequest struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type PatchOp ¶
type PatchOp string
Type of patch operation.
const PatchOpAdd PatchOp = `add`
const PatchOpRemove PatchOp = `remove`
const PatchOpReplace PatchOp = `replace`
type PatchSchema ¶ added in v0.13.0
type PatchSchema string
const PatchSchemaUrnIetfParamsScimApiMessages20PatchOp PatchSchema = `urn:ietf:params:scim:api:messages:2.0:PatchOp`
func (*PatchSchema) Set ¶ added in v0.13.0
func (f *PatchSchema) Set(v string) error
Set raw string value and validate it against allowed values
func (*PatchSchema) String ¶ added in v0.13.0
func (f *PatchSchema) String() string
String representation for fmt.Print
func (*PatchSchema) Type ¶ added in v0.13.0
func (f *PatchSchema) Type() string
Type always returns PatchSchema to satisfy [pflag.Value] interface
func (*PatchSchema) Values ¶ added in v0.72.0
func (f *PatchSchema) Values() []PatchSchema
Values returns all possible values for PatchSchema.
There is no guarantee on the order of the values in the slice.
type PatchServicePrincipalRequest ¶ added in v0.84.0
type PatchServicePrincipalRequest struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type PatchUserRequest ¶ added in v0.84.0
type PatchUserRequest struct {
// Unique ID in the Databricks workspace.
Id string `json:"-" url:"-"`
Operations []Patch `json:"Operations,omitempty"`
// The schema of the patch request. Must be
// ["urn:ietf:params:scim:api:messages:2.0:PatchOp"].
Schemas []PatchSchema `json:"schemas,omitempty"`
}
type Permission ¶
type Permission struct {
Inherited bool `json:"inherited,omitempty"`
InheritedFromObject []string `json:"inherited_from_object,omitempty"`
PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (Permission) MarshalJSON ¶ added in v0.23.0
func (s Permission) MarshalJSON() ([]byte, error)
func (*Permission) UnmarshalJSON ¶ added in v0.23.0
func (s *Permission) UnmarshalJSON(b []byte) error
type PermissionAssignment ¶
type PermissionAssignment struct {
// Error response associated with a workspace permission assignment, if any.
Error string `json:"error,omitempty"`
// The permissions level of the principal.
Permissions []WorkspacePermission `json:"permissions,omitempty"`
// Information about the principal assigned to the workspace.
Principal *PrincipalOutput `json:"principal,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
The output format for existing workspace PermissionAssignment records, which contains some info for user consumption.
func (PermissionAssignment) MarshalJSON ¶ added in v0.23.0
func (s PermissionAssignment) MarshalJSON() ([]byte, error)
func (*PermissionAssignment) UnmarshalJSON ¶ added in v0.23.0
func (s *PermissionAssignment) UnmarshalJSON(b []byte) error
type PermissionAssignments ¶
type PermissionAssignments struct {
// Array of permissions assignments defined for a workspace.
PermissionAssignments []PermissionAssignment `json:"permission_assignments,omitempty"`
}
type PermissionLevel ¶
type PermissionLevel string
Permission level
const PermissionLevelCanAttachTo PermissionLevel = `CAN_ATTACH_TO`
const PermissionLevelCanBind PermissionLevel = `CAN_BIND`
const PermissionLevelCanCreate PermissionLevel = `CAN_CREATE`
const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT`
const PermissionLevelCanEditMetadata PermissionLevel = `CAN_EDIT_METADATA`
const PermissionLevelCanManage PermissionLevel = `CAN_MANAGE`
const PermissionLevelCanManageProductionVersions PermissionLevel = `CAN_MANAGE_PRODUCTION_VERSIONS`
const PermissionLevelCanManageRun PermissionLevel = `CAN_MANAGE_RUN`
const PermissionLevelCanManageStagingVersions PermissionLevel = `CAN_MANAGE_STAGING_VERSIONS`
const PermissionLevelCanMonitor PermissionLevel = `CAN_MONITOR`
const PermissionLevelCanMonitorOnly PermissionLevel = `CAN_MONITOR_ONLY`
const PermissionLevelCanQuery PermissionLevel = `CAN_QUERY`
const PermissionLevelCanRead PermissionLevel = `CAN_READ`
const PermissionLevelCanRestart PermissionLevel = `CAN_RESTART`
const PermissionLevelCanRun PermissionLevel = `CAN_RUN`
const PermissionLevelCanUse PermissionLevel = `CAN_USE`
const PermissionLevelCanView PermissionLevel = `CAN_VIEW`
const PermissionLevelCanViewMetadata PermissionLevel = `CAN_VIEW_METADATA`
const PermissionLevelIsOwner PermissionLevel = `IS_OWNER`
func (*PermissionLevel) Set ¶
func (f *PermissionLevel) Set(v string) error
Set raw string value and validate it against allowed values
func (*PermissionLevel) String ¶
func (f *PermissionLevel) String() string
String representation for fmt.Print
func (*PermissionLevel) Type ¶
func (f *PermissionLevel) Type() string
Type always returns PermissionLevel to satisfy [pflag.Value] interface
func (*PermissionLevel) Values ¶ added in v0.72.0
func (f *PermissionLevel) Values() []PermissionLevel
Values returns all possible values for PermissionLevel.
There is no guarantee on the order of the values in the slice.
type PermissionMigrationAPI ¶ added in v0.34.0
type PermissionMigrationAPI struct {
// contains filtered or unexported fields
}
APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx
func NewPermissionMigration ¶ added in v0.34.0
func NewPermissionMigration(client *client.DatabricksClient) *PermissionMigrationAPI
func (*PermissionMigrationAPI) MigratePermissions ¶ added in v0.34.0
func (a *PermissionMigrationAPI) MigratePermissions(ctx context.Context, request MigratePermissionsRequest) (*MigratePermissionsResponse, error)
type PermissionMigrationInterface ¶ added in v0.34.0
type PermissionMigrationInterface interface {
// Migrate Permissions.
MigratePermissions(ctx context.Context, request MigratePermissionsRequest) (*MigratePermissionsResponse, error)
}
type PermissionMigrationService
deprecated
added in
v0.34.0
type PermissionMigrationService interface {
// Migrate Permissions.
MigratePermissions(ctx context.Context, request MigratePermissionsRequest) (*MigratePermissionsResponse, error)
}
APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type PermissionOutput ¶
type PermissionOutput struct {
// The results of a permissions query.
Description string `json:"description,omitempty"`
PermissionLevel WorkspacePermission `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PermissionOutput) MarshalJSON ¶ added in v0.23.0
func (s PermissionOutput) MarshalJSON() ([]byte, error)
func (*PermissionOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *PermissionOutput) UnmarshalJSON(b []byte) error
type PermissionsAPI ¶
type PermissionsAPI struct {
// contains filtered or unexported fields
}
Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints. * **[Apps permissions](:service:apps)** — Manage which users can manage or use apps. * **[Cluster permissions](:service:clusters)** — Manage which users can manage, restart, or attach to clusters. * **[Cluster policy permissions](:service:clusterpolicies)** — Manage which users can use cluster policies. * **[Delta Live Tables pipeline permissions](:service:pipelines)** — Manage which users can view, manage, run, cancel, or own a Delta Live Tables pipeline. * **[Job permissions](:service:jobs)** — Manage which users can view, manage, trigger, cancel, or own a job. * **[MLflow experiment permissions](:service:experiments)** — Manage which users can read, edit, or manage MLflow experiments. * **[MLflow registered model permissions](:service:modelregistry)** — Manage which users can read, edit, or manage MLflow registered models. * **[Instance Pool permissions](:service:instancepools)** — Manage which users can manage or attach to pools. * **[Repo permissions](repos)** — Manage which users can read, run, edit, or manage a repo. * **[Serving endpoint permissions](:service:servingendpoints)** — Manage which users can view, query, or manage a serving endpoint. * **[SQL warehouse permissions](:service:warehouses)** — Manage which users can use or manage SQL warehouses. * **[Token permissions](:service:tokenmanagement)** — Manage which users can create or use tokens. * **[Workspace object permissions](:service:workspace)** — Manage which users can read, run, edit, or manage alerts, dbsql-dashboards, directories, files, notebooks and queries. For the mapping of the required permissions for specific actions or abilities and other important information, see Access Control. Note that to manage access control on service principals, use **[Account Access Control Proxy](:service:accountaccesscontrolproxy)**.
func NewPermissions ¶
func NewPermissions(client *client.DatabricksClient) *PermissionsAPI
func (*PermissionsAPI) Get ¶
func (a *PermissionsAPI) Get(ctx context.Context, request GetPermissionRequest) (*ObjectPermissions, error)
Example (GenericPermissions) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
obj, err := w.Workspace.GetStatusByPath(ctx, notebookPath)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", obj)
_, err = w.Permissions.Get(ctx, iam.GetPermissionRequest{
RequestObjectType: "notebooks",
RequestObjectId: fmt.Sprintf("%d", obj.ObjectId),
})
if err != nil {
panic(err)
}
func (*PermissionsAPI) GetByRequestObjectTypeAndRequestObjectId ¶
func (a *PermissionsAPI) GetByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*ObjectPermissions, error)
Gets the permissions of an object. Objects can inherit permissions from their parent objects or root object.
func (*PermissionsAPI) GetPermissionLevels ¶
func (a *PermissionsAPI) GetPermissionLevels(ctx context.Context, request GetPermissionLevelsRequest) (*GetPermissionLevelsResponse, error)
Example (GenericPermissions) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
obj, err := w.Workspace.GetStatusByPath(ctx, notebookPath)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", obj)
levels, err := w.Permissions.GetPermissionLevels(ctx, iam.GetPermissionLevelsRequest{
RequestObjectType: "notebooks",
RequestObjectId: fmt.Sprintf("%d", obj.ObjectId),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", levels)
func (*PermissionsAPI) GetPermissionLevelsByRequestObjectTypeAndRequestObjectId ¶
func (a *PermissionsAPI) GetPermissionLevelsByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*GetPermissionLevelsResponse, error)
Gets the permission levels that a user can have on an object.
func (*PermissionsAPI) Set ¶
func (a *PermissionsAPI) Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error)
Example (GenericPermissions) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
notebookPath := func() string {
me, err := w.CurrentUser.Me(ctx)
if err != nil {
panic(err)
}
return filepath.Join("/Users", me.UserName, fmt.Sprintf("sdk-%x", time.Now().UnixNano()))
}()
group, err := w.Groups.Create(ctx, iam.Group{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", group)
obj, err := w.Workspace.GetStatusByPath(ctx, notebookPath)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", obj)
_, err = w.Permissions.Set(ctx, iam.SetObjectPermissions{
RequestObjectType: "notebooks",
RequestObjectId: fmt.Sprintf("%d", obj.ObjectId),
AccessControlList: []iam.AccessControlRequest{iam.AccessControlRequest{
GroupName: group.DisplayName,
PermissionLevel: iam.PermissionLevelCanRun,
}},
})
if err != nil {
panic(err)
}
// cleanup
err = w.Groups.DeleteById(ctx, group.Id)
if err != nil {
panic(err)
}
func (*PermissionsAPI) Update ¶
func (a *PermissionsAPI) Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error)
type PermissionsDescription ¶
type PermissionsDescription struct {
Description string `json:"description,omitempty"`
PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (PermissionsDescription) MarshalJSON ¶ added in v0.23.0
func (s PermissionsDescription) MarshalJSON() ([]byte, error)
func (*PermissionsDescription) UnmarshalJSON ¶ added in v0.23.0
func (s *PermissionsDescription) UnmarshalJSON(b []byte) error
type PermissionsInterface ¶ added in v0.29.0
type PermissionsInterface interface {
// Gets the permissions of an object. Objects can inherit permissions from their
// parent objects or root object.
Get(ctx context.Context, request GetPermissionRequest) (*ObjectPermissions, error)
// Gets the permissions of an object. Objects can inherit permissions from their
// parent objects or root object.
GetByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*ObjectPermissions, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetPermissionLevelsRequest) (*GetPermissionLevelsResponse, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevelsByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*GetPermissionLevelsResponse, error)
// Sets permissions on an object, replacing existing permissions if they exist.
// Deletes all direct permissions if none are specified. Objects can inherit
// permissions from their parent objects or root object.
Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error)
// Updates the permissions on an object. Objects can inherit permissions from
// their parent objects or root object.
Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error)
}
type PermissionsService
deprecated
type PermissionsService interface {
// Gets the permissions of an object. Objects can inherit permissions from
// their parent objects or root object.
Get(ctx context.Context, request GetPermissionRequest) (*ObjectPermissions, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetPermissionLevelsRequest) (*GetPermissionLevelsResponse, error)
// Sets permissions on an object, replacing existing permissions if they
// exist. Deletes all direct permissions if none are specified. Objects can
// inherit permissions from their parent objects or root object.
Set(ctx context.Context, request SetObjectPermissions) (*ObjectPermissions, error)
// Updates the permissions on an object. Objects can inherit permissions
// from their parent objects or root object.
Update(ctx context.Context, request UpdateObjectPermissions) (*ObjectPermissions, error)
}
Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints. * **[Apps permissions](:service:apps)** — Manage which users can manage or use apps. * **[Cluster permissions](:service:clusters)** — Manage which users can manage, restart, or attach to clusters. * **[Cluster policy permissions](:service:clusterpolicies)** — Manage which users can use cluster policies. * **[Delta Live Tables pipeline permissions](:service:pipelines)** — Manage which users can view, manage, run, cancel, or own a Delta Live Tables pipeline. * **[Job permissions](:service:jobs)** — Manage which users can view, manage, trigger, cancel, or own a job. * **[MLflow experiment permissions](:service:experiments)** — Manage which users can read, edit, or manage MLflow experiments. * **[MLflow registered model permissions](:service:modelregistry)** — Manage which users can read, edit, or manage MLflow registered models. * **[Instance Pool permissions](:service:instancepools)** — Manage which users can manage or attach to pools. * **[Repo permissions](repos)** — Manage which users can read, run, edit, or manage a repo. * **[Serving endpoint permissions](:service:servingendpoints)** — Manage which users can view, query, or manage a serving endpoint. * **[SQL warehouse permissions](:service:warehouses)** — Manage which users can use or manage SQL warehouses. * **[Token permissions](:service:tokenmanagement)** — Manage which users can create or use tokens. * **[Workspace object permissions](:service:workspace)** — Manage which users can read, run, edit, or manage alerts, dbsql-dashboards, directories, files, notebooks and queries. For the mapping of the required permissions for specific actions or abilities and other important information, see Access Control. Note that to manage access control on service principals, use **[Account Access Control Proxy](:service:accountaccesscontrolproxy)**.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type PrincipalOutput ¶
type PrincipalOutput struct {
// The display name of the principal.
DisplayName string `json:"display_name,omitempty"`
// The group name of the group. Present only if the principal is a group.
GroupName string `json:"group_name,omitempty"`
// The unique, opaque id of the principal.
PrincipalId int64 `json:"principal_id,omitempty"`
// The name of the service principal. Present only if the principal is a
// service principal.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// The username of the user. Present only if the principal is a user.
UserName string `json:"user_name,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
Information about the principal assigned to the workspace.
func (PrincipalOutput) MarshalJSON ¶ added in v0.23.0
func (s PrincipalOutput) MarshalJSON() ([]byte, error)
func (*PrincipalOutput) UnmarshalJSON ¶ added in v0.23.0
func (s *PrincipalOutput) UnmarshalJSON(b []byte) error
type RequestAuthzIdentity ¶ added in v0.56.0
type RequestAuthzIdentity string
Defines the identity to be used for authZ of the request on the server side. See one pager for for more information: http://go/acl/service-identity
const RequestAuthzIdentityRequestAuthzIdentityServiceIdentity RequestAuthzIdentity = `REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY`
const RequestAuthzIdentityRequestAuthzIdentityUserContext RequestAuthzIdentity = `REQUEST_AUTHZ_IDENTITY_USER_CONTEXT`
func (*RequestAuthzIdentity) Set ¶ added in v0.56.0
func (f *RequestAuthzIdentity) Set(v string) error
Set raw string value and validate it against allowed values
func (*RequestAuthzIdentity) String ¶ added in v0.56.0
func (f *RequestAuthzIdentity) String() string
String representation for fmt.Print
func (*RequestAuthzIdentity) Type ¶ added in v0.56.0
func (f *RequestAuthzIdentity) Type() string
Type always returns RequestAuthzIdentity to satisfy [pflag.Value] interface
func (*RequestAuthzIdentity) Values ¶ added in v0.72.0
func (f *RequestAuthzIdentity) Values() []RequestAuthzIdentity
Values returns all possible values for RequestAuthzIdentity.
There is no guarantee on the order of the values in the slice.
type ResourceInfo ¶ added in v0.56.0
type ResourceInfo struct {
// Id of the current resource.
Id string `json:"id" url:"id"`
// The legacy acl path of the current resource.
LegacyAclPath string `json:"legacy_acl_path,omitempty" url:"legacy_acl_path,omitempty"`
// Parent resource info for the current resource. The parent may have
// another parent.
ParentResourceInfo *ResourceInfo `json:"parent_resource_info,omitempty" url:"parent_resource_info,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ResourceInfo) MarshalJSON ¶ added in v0.56.0
func (s ResourceInfo) MarshalJSON() ([]byte, error)
func (*ResourceInfo) UnmarshalJSON ¶ added in v0.56.0
func (s *ResourceInfo) UnmarshalJSON(b []byte) error
type ResourceMeta ¶ added in v0.12.0
type ResourceMeta struct {
// Identifier for group type. Can be local workspace group
// (`WorkspaceGroup`) or account group (`Group`).
ResourceType string `json:"resourceType,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ResourceMeta) MarshalJSON ¶ added in v0.23.0
func (s ResourceMeta) MarshalJSON() ([]byte, error)
func (*ResourceMeta) UnmarshalJSON ¶ added in v0.23.0
func (s *ResourceMeta) UnmarshalJSON(b []byte) error
type Role ¶ added in v0.15.0
type Role struct {
// Role to assign to a principal or a list of principals on a resource.
Name string `json:"name"`
}
type RuleSetResponse ¶ added in v0.10.0
type RuleSetResponse struct {
// Identifies the version of the rule set returned. Etag used for
// versioning. The response is at least as fresh as the eTag provided. Etag
// is used for optimistic concurrency control as a way to help prevent
// simultaneous updates of a rule set from overwriting each other. It is
// strongly suggested that systems make use of the etag in the read ->
// modify -> write pattern to perform rule set updates in order to avoid
// race conditions that is get an etag from a GET rule set request, and pass
// it with the PUT update request to identify the rule set version you are
// updating.
Etag string `json:"etag"`
GrantRules []GrantRule `json:"grant_rules,omitempty"`
// Name of the rule set.
Name string `json:"name"`
}
type RuleSetUpdateRequest ¶ added in v0.10.0
type RuleSetUpdateRequest struct {
// Identifies the version of the rule set returned. Etag used for
// versioning. The response is at least as fresh as the eTag provided. Etag
// is used for optimistic concurrency control as a way to help prevent
// simultaneous updates of a rule set from overwriting each other. It is
// strongly suggested that systems make use of the etag in the read ->
// modify -> write pattern to perform rule set updates in order to avoid
// race conditions that is get an etag from a GET rule set request, and pass
// it with the PUT update request to identify the rule set version you are
// updating.
Etag string `json:"etag"`
GrantRules []GrantRule `json:"grant_rules,omitempty"`
// Name of the rule set.
Name string `json:"name"`
}
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 assigned to the service principal. See [assigning
// entitlements] for a full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks service principal ID.
Id string `json:"id,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the List response.
Schemas []ServicePrincipalSchema `json:"schemas,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (ServicePrincipal) MarshalJSON ¶ added in v0.23.0
func (s ServicePrincipal) MarshalJSON() ([]byte, error)
func (*ServicePrincipal) UnmarshalJSON ¶ added in v0.23.0
func (s *ServicePrincipal) UnmarshalJSON(b []byte) error
type ServicePrincipalSchema ¶ added in v0.24.0
type ServicePrincipalSchema string
const ServicePrincipalSchemaUrnIetfParamsScimSchemasCore20ServicePrincipal ServicePrincipalSchema = `urn:ietf:params:scim:schemas:core:2.0:ServicePrincipal`
func (*ServicePrincipalSchema) Set ¶ added in v0.24.0
func (f *ServicePrincipalSchema) Set(v string) error
Set raw string value and validate it against allowed values
func (*ServicePrincipalSchema) String ¶ added in v0.24.0
func (f *ServicePrincipalSchema) String() string
String representation for fmt.Print
func (*ServicePrincipalSchema) Type ¶ added in v0.24.0
func (f *ServicePrincipalSchema) Type() string
Type always returns ServicePrincipalSchema to satisfy [pflag.Value] interface
func (*ServicePrincipalSchema) Values ¶ added in v0.72.0
func (f *ServicePrincipalSchema) Values() []ServicePrincipalSchema
Values returns all possible values for ServicePrincipalSchema.
There is no guarantee on the order of the values in the slice.
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 ¶
func (a *ServicePrincipalsAPI) Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
Example (AccountServicePrincipal) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spCreate, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
Active: true,
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spCreate)
// cleanup
err = a.ServicePrincipals.Delete(ctx, iam.DeleteAccountServicePrincipalRequest{
Id: spCreate.Id,
})
if err != nil {
panic(err)
}
Example (CreateOboTokenOnAws) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
groups, err := w.Groups.GroupDisplayNameToIdMap(ctx, iam.ListGroupsRequest{})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", groups)
spn, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Groups: []iam.ComplexValue{iam.ComplexValue{
Value: groups["admins"],
}},
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spn)
// cleanup
err = w.ServicePrincipals.DeleteById(ctx, spn.Id)
if err != nil {
panic(err)
}
Example (ServicePrincipalsOnAws) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
created, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", created)
// cleanup
err = w.ServicePrincipals.DeleteById(ctx, created.Id)
if err != nil {
panic(err)
}
Example (WorkspaceAssignmentOnAws) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spn, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spn)
func (*ServicePrincipalsAPI) Delete ¶
func (a *ServicePrincipalsAPI) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
func (*ServicePrincipalsAPI) DeleteById ¶
func (a *ServicePrincipalsAPI) DeleteById(ctx context.Context, id string) error
Delete a single service principal in the Databricks workspace.
func (*ServicePrincipalsAPI) Get ¶
func (a *ServicePrincipalsAPI) Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
Example (AccountServicePrincipal) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spCreate, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
Active: true,
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spCreate)
sp, err := a.ServicePrincipals.GetById(ctx, spCreate.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", sp)
// cleanup
err = a.ServicePrincipals.Delete(ctx, iam.DeleteAccountServicePrincipalRequest{
Id: spCreate.Id,
})
if err != nil {
panic(err)
}
Example (ServicePrincipalsOnAws) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
created, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", created)
byId, err := w.ServicePrincipals.GetById(ctx, created.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", byId)
// cleanup
err = w.ServicePrincipals.DeleteById(ctx, created.Id)
if err != nil {
panic(err)
}
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 ¶
func (a *ServicePrincipalsAPI) GetById(ctx context.Context, id string) (*ServicePrincipal, error)
Gets the details for a single service principal define in the Databricks workspace.
func (*ServicePrincipalsAPI) List ¶ added in v0.24.0
func (a *ServicePrincipalsAPI) List(ctx context.Context, request ListServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
Gets the set of service principals associated with a Databricks workspace.
Example (AccountServicePrincipal) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spCreate, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
Active: true,
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spCreate)
sp, err := a.ServicePrincipals.GetById(ctx, spCreate.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", sp)
spList, err := a.ServicePrincipals.ListAll(ctx, iam.ListAccountServicePrincipalsRequest{
Filter: fmt.Sprintf("displayName eq %v", sp.DisplayName),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spList)
// cleanup
err = a.ServicePrincipals.Delete(ctx, iam.DeleteAccountServicePrincipalRequest{
Id: spCreate.Id,
})
if err != nil {
panic(err)
}
Example (ServicePrincipalsOnAws) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
all, err := w.ServicePrincipals.ListAll(ctx, iam.ListServicePrincipalsRequest{})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", all)
func (*ServicePrincipalsAPI) ListAll ¶
func (a *ServicePrincipalsAPI) ListAll(ctx context.Context, request ListServicePrincipalsRequest) ([]ServicePrincipal, error)
Gets the set of service principals associated with a Databricks workspace.
func (*ServicePrincipalsAPI) Patch ¶
func (a *ServicePrincipalsAPI) Patch(ctx context.Context, request PartialUpdate) error
Example (AccountServicePrincipal) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spCreate, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
Active: true,
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spCreate)
sp, err := a.ServicePrincipals.GetById(ctx, spCreate.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", sp)
err = a.ServicePrincipals.Patch(ctx, iam.PartialUpdate{
Id: sp.Id,
Operations: []iam.Patch{iam.Patch{
Op: iam.PatchOpReplace,
Path: "active",
Value: "false",
}},
Schemas: []iam.PatchSchema{iam.PatchSchemaUrnIetfParamsScimApiMessages20PatchOp},
})
if err != nil {
panic(err)
}
// cleanup
err = a.ServicePrincipals.Delete(ctx, iam.DeleteAccountServicePrincipalRequest{
Id: spCreate.Id,
})
if err != nil {
panic(err)
}
Example (ServicePrincipalsOnAws) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
created, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", created)
byId, err := w.ServicePrincipals.GetById(ctx, created.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", byId)
err = w.ServicePrincipals.Patch(ctx, iam.PartialUpdate{
Id: byId.Id,
Operations: []iam.Patch{iam.Patch{
Op: iam.PatchOpReplace,
Path: "active",
Value: "false",
}},
Schemas: []iam.PatchSchema{iam.PatchSchemaUrnIetfParamsScimApiMessages20PatchOp},
})
if err != nil {
panic(err)
}
// cleanup
err = w.ServicePrincipals.DeleteById(ctx, created.Id)
if err != nil {
panic(err)
}
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
Example (AccountServicePrincipal) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spCreate, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
Active: true,
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spCreate)
sp, err := a.ServicePrincipals.GetById(ctx, spCreate.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", sp)
err = a.ServicePrincipals.Update(ctx, iam.ServicePrincipal{
Active: true,
DisplayName: sp.DisplayName,
Id: sp.Id,
})
if err != nil {
panic(err)
}
// cleanup
err = a.ServicePrincipals.Delete(ctx, iam.DeleteAccountServicePrincipalRequest{
Id: spCreate.Id,
})
if err != nil {
panic(err)
}
Example (ServicePrincipalsOnAws) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
created, err := w.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", created)
err = w.ServicePrincipals.Update(ctx, iam.ServicePrincipal{
Id: created.Id,
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
Roles: []iam.ComplexValue{iam.ComplexValue{
Value: "xyz",
}},
})
if err != nil {
panic(err)
}
// cleanup
err = w.ServicePrincipals.DeleteById(ctx, created.Id)
if err != nil {
panic(err)
}
type ServicePrincipalsInterface ¶ added in v0.29.0
type ServicePrincipalsInterface interface {
// Creates a new service principal in the Databricks workspace.
Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
// Delete a single service principal in the Databricks workspace.
Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
// Delete a single service principal in the Databricks workspace.
DeleteById(ctx context.Context, id string) error
// Gets the details for a single service principal define in the Databricks
// workspace.
Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
// Gets the details for a single service principal define in the Databricks
// workspace.
GetById(ctx context.Context, id string) (*ServicePrincipal, error)
// Gets the set of service principals associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
// Gets the set of service principals associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListServicePrincipalsRequest) ([]ServicePrincipal, 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.
ServicePrincipalDisplayNameToIdMap(ctx context.Context, request ListServicePrincipalsRequest) (map[string]string, 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.
GetByDisplayName(ctx context.Context, name string) (*ServicePrincipal, error)
// Partially updates the details of a single service principal in the Databricks
// workspace.
Patch(ctx context.Context, request PartialUpdate) error
// 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
}
type ServicePrincipalsService
deprecated
type ServicePrincipalsService interface {
// Creates a new service principal in the Databricks workspace.
Create(ctx context.Context, request ServicePrincipal) (*ServicePrincipal, error)
// Delete a single service principal in the Databricks workspace.
Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
// Gets the details for a single service principal define in the Databricks
// workspace.
Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
// Gets the set of service principals associated with a Databricks
// workspace.
List(ctx context.Context, request ListServicePrincipalsRequest) (*ListServicePrincipalResponse, error)
// Partially updates the details of a single service principal in the
// Databricks workspace.
Patch(ctx context.Context, request PartialUpdate) error
// 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type ServicePrincipalsV2API ¶ added in v0.84.0
type ServicePrincipalsV2API 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 NewServicePrincipalsV2 ¶ added in v0.84.0
func NewServicePrincipalsV2(client *client.DatabricksClient) *ServicePrincipalsV2API
func (*ServicePrincipalsV2API) Create ¶ added in v0.84.0
func (a *ServicePrincipalsV2API) Create(ctx context.Context, request CreateServicePrincipalRequest) (*ServicePrincipal, error)
func (*ServicePrincipalsV2API) Delete ¶ added in v0.84.0
func (a *ServicePrincipalsV2API) Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
func (*ServicePrincipalsV2API) Get ¶ added in v0.84.0
func (a *ServicePrincipalsV2API) Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
func (*ServicePrincipalsV2API) List ¶ added in v0.84.0
func (a *ServicePrincipalsV2API) List(ctx context.Context, request ListServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
Gets the set of service principals associated with a Databricks workspace.
func (*ServicePrincipalsV2API) ListAll ¶ added in v0.84.0
func (a *ServicePrincipalsV2API) ListAll(ctx context.Context, request ListServicePrincipalsRequest) ([]ServicePrincipal, error)
Gets the set of service principals associated with a Databricks workspace.
type ServicePrincipalsV2Interface ¶ added in v0.84.0
type ServicePrincipalsV2Interface interface {
// Creates a new service principal in the Databricks workspace.
Create(ctx context.Context, request CreateServicePrincipalRequest) (*ServicePrincipal, error)
// Delete a single service principal in the Databricks workspace.
Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
// Gets the details for a single service principal define in the Databricks
// workspace.
Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
// Gets the set of service principals associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListServicePrincipalsRequest) listing.Iterator[ServicePrincipal]
// Gets the set of service principals associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListServicePrincipalsRequest) ([]ServicePrincipal, error)
// Partially updates the details of a single service principal in the Databricks
// workspace.
Patch(ctx context.Context, request PatchServicePrincipalRequest) error
// Updates the details of a single service principal.
//
// This action replaces the existing service principal with the same name.
Update(ctx context.Context, request UpdateServicePrincipalRequest) error
}
type ServicePrincipalsV2Service
deprecated
added in
v0.84.0
type ServicePrincipalsV2Service interface {
// Creates a new service principal in the Databricks workspace.
Create(ctx context.Context, request CreateServicePrincipalRequest) (*ServicePrincipal, error)
// Delete a single service principal in the Databricks workspace.
Delete(ctx context.Context, request DeleteServicePrincipalRequest) error
// Gets the details for a single service principal define in the Databricks
// workspace.
Get(ctx context.Context, request GetServicePrincipalRequest) (*ServicePrincipal, error)
// Gets the set of service principals associated with a Databricks
// workspace.
List(ctx context.Context, request ListServicePrincipalsRequest) (*ListServicePrincipalResponse, error)
// Partially updates the details of a single service principal in the
// Databricks workspace.
Patch(ctx context.Context, request PatchServicePrincipalRequest) error
// Updates the details of a single service principal.
//
// This action replaces the existing service principal with the same name.
Update(ctx context.Context, request UpdateServicePrincipalRequest) 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type SetObjectPermissions ¶ added in v0.69.0
type SetObjectPermissions struct {
AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"`
// The id of the request object.
RequestObjectId string `json:"-" url:"-"`
// The type of the request object. Can be one of the following: alerts,
// alertsv2, authorization, clusters, cluster-policies, dashboards,
// dbsql-dashboards, directories, experiments, files, genie, instance-pools,
// jobs, notebooks, pipelines, queries, registered-models, repos,
// serving-endpoints, or warehouses.
RequestObjectType string `json:"-" url:"-"`
}
type UpdateAccountGroupRequest ¶ added in v0.84.0
type UpdateAccountGroupRequest struct {
// String that represents a human-readable group name
DisplayName string `json:"displayName,omitempty"`
ExternalId string `json:"externalId,omitempty"`
// Databricks group ID
Id string `json:"-" url:"-"`
Members []ComplexValue `json:"members,omitempty"`
// Container for the group identifier. Workspace local versus account.
Meta *ResourceMeta `json:"meta,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (UpdateAccountGroupRequest) MarshalJSON ¶ added in v0.84.0
func (s UpdateAccountGroupRequest) MarshalJSON() ([]byte, error)
func (*UpdateAccountGroupRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *UpdateAccountGroupRequest) UnmarshalJSON(b []byte) error
type UpdateAccountServicePrincipalRequest ¶ added in v0.84.0
type UpdateAccountServicePrincipalRequest 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"`
ExternalId string `json:"externalId,omitempty"`
// Databricks service principal ID.
Id string `json:"-" url:"-"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (UpdateAccountServicePrincipalRequest) MarshalJSON ¶ added in v0.84.0
func (s UpdateAccountServicePrincipalRequest) MarshalJSON() ([]byte, error)
func (*UpdateAccountServicePrincipalRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *UpdateAccountServicePrincipalRequest) UnmarshalJSON(b []byte) error
type UpdateAccountUserRequest ¶ added in v0.84.0
type UpdateAccountUserRequest 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"`
// External ID is not currently supported. It is reserved for future use.
ExternalId string `json:"externalId,omitempty"`
// Databricks user ID.
Id string `json:"-" url:"-"`
Name *Name `json:"name,omitempty"`
// Indicates if the group has the admin role.
Roles []ComplexValue `json:"roles,omitempty"`
// Email address of the Databricks user.
UserName string `json:"userName,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (UpdateAccountUserRequest) MarshalJSON ¶ added in v0.84.0
func (s UpdateAccountUserRequest) MarshalJSON() ([]byte, error)
func (*UpdateAccountUserRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *UpdateAccountUserRequest) UnmarshalJSON(b []byte) error
type UpdateGroupRequest ¶ added in v0.84.0
type UpdateGroupRequest struct {
// String that represents a human-readable group name
DisplayName string `json:"displayName,omitempty"`
// Entitlements assigned to the group. See [assigning entitlements] for a
// full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks group ID
Id string `json:"-" url:"-"`
Members []ComplexValue `json:"members,omitempty"`
// Container for the group identifier. Workspace local versus account.
Meta *ResourceMeta `json:"meta,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the group.
Schemas []GroupSchema `json:"schemas,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (UpdateGroupRequest) MarshalJSON ¶ added in v0.84.0
func (s UpdateGroupRequest) MarshalJSON() ([]byte, error)
func (*UpdateGroupRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *UpdateGroupRequest) UnmarshalJSON(b []byte) error
type UpdateObjectPermissions ¶ added in v0.69.0
type UpdateObjectPermissions struct {
AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"`
// The id of the request object.
RequestObjectId string `json:"-" url:"-"`
// The type of the request object. Can be one of the following: alerts,
// alertsv2, authorization, clusters, cluster-policies, dashboards,
// dbsql-dashboards, directories, experiments, files, genie, instance-pools,
// jobs, notebooks, pipelines, queries, registered-models, repos,
// serving-endpoints, or warehouses.
RequestObjectType string `json:"-" url:"-"`
}
type UpdateRuleSetRequest ¶ added in v0.10.0
type UpdateRuleSetRequest struct {
// Name of the rule set.
Name string `json:"name"`
RuleSet RuleSetUpdateRequest `json:"rule_set"`
}
type UpdateServicePrincipalRequest ¶ added in v0.84.0
type UpdateServicePrincipalRequest 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 assigned to the service principal. See [assigning
// entitlements] for a full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks service principal ID.
Id string `json:"-" url:"-"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the List response.
Schemas []ServicePrincipalSchema `json:"schemas,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (UpdateServicePrincipalRequest) MarshalJSON ¶ added in v0.84.0
func (s UpdateServicePrincipalRequest) MarshalJSON() ([]byte, error)
func (*UpdateServicePrincipalRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *UpdateServicePrincipalRequest) UnmarshalJSON(b []byte) error
type UpdateUserRequest ¶ added in v0.84.0
type UpdateUserRequest 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`. This field cannot be updated through the Workspace
// SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to
// update `displayName`.
//
// [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation
DisplayName string `json:"displayName,omitempty"`
// All the emails associated with the Databricks user.
Emails []ComplexValue `json:"emails,omitempty"`
// Entitlements assigned to the user. See [assigning entitlements] for a
// full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
// External ID is not currently supported. It is reserved for future use.
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks user ID.
Id string `json:"-" url:"-"`
Name *Name `json:"name,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the user.
Schemas []UserSchema `json:"schemas,omitempty"`
// Email address of the Databricks user.
UserName string `json:"userName,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (UpdateUserRequest) MarshalJSON ¶ added in v0.84.0
func (s UpdateUserRequest) MarshalJSON() ([]byte, error)
func (*UpdateUserRequest) UnmarshalJSON ¶ added in v0.84.0
func (s *UpdateUserRequest) UnmarshalJSON(b []byte) error
type UpdateWorkspaceAssignments ¶
type UpdateWorkspaceAssignments struct {
// Array of permissions assignments to update on the workspace. Valid values
// are "USER" and "ADMIN" (case-sensitive). If both "USER" and "ADMIN" are
// provided, "ADMIN" takes precedence. Other values will be ignored. Note
// that excluding this field, or providing unsupported values, will have the
// same effect as providing an empty list, which will result in the deletion
// of all permissions for the principal.
Permissions []WorkspacePermission `json:"permissions,omitempty"`
// The ID of the user, service principal, or group.
PrincipalId int64 `json:"-" url:"-"`
// The workspace ID.
WorkspaceId int64 `json:"-" url:"-"`
}
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`. This field cannot be updated through the Workspace
// SCIM APIs when [identity federation is enabled]. Use Account SCIM APIs to
// update `displayName`.
//
// [identity federation is enabled]: https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation
DisplayName string `json:"displayName,omitempty"`
// All the emails associated with the Databricks user.
Emails []ComplexValue `json:"emails,omitempty"`
// Entitlements assigned to the user. See [assigning entitlements] for a
// full list of supported values.
//
// [assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
Entitlements []ComplexValue `json:"entitlements,omitempty"`
// External ID is not currently supported. It is reserved for future use.
ExternalId string `json:"externalId,omitempty"`
Groups []ComplexValue `json:"groups,omitempty"`
// Databricks user ID.
Id string `json:"id,omitempty"`
Name *Name `json:"name,omitempty"`
// Corresponds to AWS instance profile/arn role.
Roles []ComplexValue `json:"roles,omitempty"`
// The schema of the user.
Schemas []UserSchema `json:"schemas,omitempty"`
// Email address of the Databricks user.
UserName string `json:"userName,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
func (User) MarshalJSON ¶ added in v0.23.0
func (*User) UnmarshalJSON ¶ added in v0.23.0
type UserSchema ¶ added in v0.24.0
type UserSchema string
const UserSchemaUrnIetfParamsScimSchemasCore20User UserSchema = `urn:ietf:params:scim:schemas:core:2.0:User`
const UserSchemaUrnIetfParamsScimSchemasExtensionWorkspace20User UserSchema = `urn:ietf:params:scim:schemas:extension:workspace:2.0:User`
func (*UserSchema) Set ¶ added in v0.24.0
func (f *UserSchema) Set(v string) error
Set raw string value and validate it against allowed values
func (*UserSchema) String ¶ added in v0.24.0
func (f *UserSchema) String() string
String representation for fmt.Print
func (*UserSchema) Type ¶ added in v0.24.0
func (f *UserSchema) Type() string
Type always returns UserSchema to satisfy [pflag.Value] interface
func (*UserSchema) Values ¶ added in v0.72.0
func (f *UserSchema) Values() []UserSchema
Values returns all possible values for UserSchema.
There is no guarantee on the order of the values in the slice.
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 ¶
Example (AccountUsers) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
user, err := a.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
// cleanup
err = a.Users.DeleteById(ctx, user.Id)
if err != nil {
panic(err)
}
Example (ClustersApiIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
otherOwner, err := w.Users.Create(ctx, iam.User{
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", otherOwner)
// cleanup
err = w.Users.DeleteById(ctx, otherOwner.Id)
if err != nil {
panic(err)
}
Example (WorkspaceUsers) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
user, err := w.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
func (*UsersAPI) Delete ¶
func (a *UsersAPI) Delete(ctx context.Context, request DeleteUserRequest) error
Example (AccountUsers) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
user, err := a.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
err = a.Users.DeleteById(ctx, user.Id)
if err != nil {
panic(err)
}
Example (ClustersApiIntegration) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
otherOwner, err := w.Users.Create(ctx, iam.User{
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", otherOwner)
err = w.Users.DeleteById(ctx, otherOwner.Id)
if err != nil {
panic(err)
}
Example (WorkspaceUsers) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
user, err := w.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
err = w.Users.DeleteById(ctx, user.Id)
if err != nil {
panic(err)
}
func (*UsersAPI) DeleteById ¶
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)
Example (AccountUsers) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
user, err := a.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
byId, err := a.Users.GetById(ctx, user.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", byId)
// cleanup
err = a.Users.DeleteById(ctx, user.Id)
if err != nil {
panic(err)
}
Example (WorkspaceUsers) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
user, err := w.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
fetch, err := w.Users.GetById(ctx, user.Id)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", fetch)
func (*UsersAPI) GetByUserName ¶
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) GetPermissionLevels ¶ added in v0.19.0
func (a *UsersAPI) GetPermissionLevels(ctx context.Context) (*GetPasswordPermissionLevelsResponse, error)
func (*UsersAPI) GetPermissions ¶ added in v0.19.0
func (a *UsersAPI) GetPermissions(ctx context.Context) (*PasswordPermissions, error)
func (*UsersAPI) List ¶ added in v0.24.0
Gets details for all the users associated with a Databricks workspace.
Example (WorkspaceUsers) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
allUsers, err := w.Users.ListAll(ctx, iam.ListUsersRequest{
Attributes: "id,userName",
SortBy: "userName",
SortOrder: iam.ListSortOrderDescending,
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", allUsers)
func (*UsersAPI) ListAll ¶
func (a *UsersAPI) ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)
Gets details for all the users associated with a Databricks workspace.
func (*UsersAPI) Patch ¶
func (a *UsersAPI) Patch(ctx context.Context, request PartialUpdate) error
Example (AccountUsers) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
user, err := a.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
err = a.Users.Patch(ctx, iam.PartialUpdate{
Id: user.Id,
Schemas: []iam.PatchSchema{iam.PatchSchemaUrnIetfParamsScimApiMessages20PatchOp},
Operations: []iam.Patch{iam.Patch{
Op: iam.PatchOpAdd,
Value: iam.User{
Roles: []iam.ComplexValue{iam.ComplexValue{
Value: "account_admin",
}},
},
}},
})
if err != nil {
panic(err)
}
// cleanup
err = a.Users.DeleteById(ctx, user.Id)
if err != nil {
panic(err)
}
Example (WorkspaceUsers) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
user, err := w.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
err = w.Users.Patch(ctx, iam.PartialUpdate{
Id: user.Id,
Operations: []iam.Patch{iam.Patch{
Op: iam.PatchOpReplace,
Path: "active",
Value: "false",
}},
Schemas: []iam.PatchSchema{iam.PatchSchemaUrnIetfParamsScimApiMessages20PatchOp},
})
if err != nil {
panic(err)
}
func (*UsersAPI) SetPermissions ¶ added in v0.19.0
func (a *UsersAPI) SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
func (*UsersAPI) Update ¶
Example (WorkspaceUsers) ¶
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
panic(err)
}
user, err := w.Users.Create(ctx, iam.User{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
UserName: fmt.Sprintf("sdk-%x@example.com", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", user)
err = w.Users.Update(ctx, iam.User{
Id: user.Id,
UserName: user.UserName,
Active: true,
})
if err != nil {
panic(err)
}
func (*UsersAPI) UpdatePermissions ¶ added in v0.19.0
func (a *UsersAPI) UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
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.
type UsersInterface ¶ added in v0.29.0
type UsersInterface interface {
// 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)
// Deletes a user. Deleting a user from a Databricks workspace also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteUserRequest) error
// Deletes a user. Deleting a user from a Databricks workspace also removes
// objects associated with the user.
DeleteById(ctx context.Context, id string) error
// Gets information for a specific user in Databricks workspace.
Get(ctx context.Context, request GetUserRequest) (*User, error)
// Gets information for a specific user in Databricks workspace.
GetById(ctx context.Context, id string) (*User, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context) (*GetPasswordPermissionLevelsResponse, error)
// Gets the permissions of all passwords. Passwords can inherit permissions from
// their root object.
GetPermissions(ctx context.Context) (*PasswordPermissions, error)
// Gets details for all the users associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListUsersRequest) listing.Iterator[User]
// Gets details for all the users associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListUsersRequest) ([]User, 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.
UserUserNameToIdMap(ctx context.Context, request ListUsersRequest) (map[string]string, 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.
GetByUserName(ctx context.Context, name string) (*User, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PartialUpdate) error
// Sets permissions on an object, replacing existing permissions if they exist.
// Deletes all direct permissions if none are specified. Objects can inherit
// permissions from their root object.
SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request User) error
// Updates the permissions on all passwords. Passwords can inherit permissions
// from their root object.
UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
}
type UsersService
deprecated
type UsersService interface {
// 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)
// Deletes a user. Deleting a user from a Databricks workspace also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteUserRequest) error
// Gets information for a specific user in Databricks workspace.
Get(ctx context.Context, request GetUserRequest) (*User, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context) (*GetPasswordPermissionLevelsResponse, error)
// Gets the permissions of all passwords. Passwords can inherit permissions
// from their root object.
GetPermissions(ctx context.Context) (*PasswordPermissions, error)
// Gets details for all the users associated with a Databricks workspace.
List(ctx context.Context, request ListUsersRequest) (*ListUsersResponse, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PartialUpdate) error
// Sets permissions on an object, replacing existing permissions if they
// exist. Deletes all direct permissions if none are specified. Objects can
// inherit permissions from their root object.
SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request User) error
// Updates the permissions on all passwords. Passwords can inherit
// permissions from their root object.
UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type UsersV2API ¶ added in v0.84.0
type UsersV2API 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 NewUsersV2 ¶ added in v0.84.0
func NewUsersV2(client *client.DatabricksClient) *UsersV2API
func (*UsersV2API) Create ¶ added in v0.84.0
func (a *UsersV2API) Create(ctx context.Context, request CreateUserRequest) (*User, error)
func (*UsersV2API) Delete ¶ added in v0.84.0
func (a *UsersV2API) Delete(ctx context.Context, request DeleteUserRequest) error
func (*UsersV2API) Get ¶ added in v0.84.0
func (a *UsersV2API) Get(ctx context.Context, request GetUserRequest) (*User, error)
func (*UsersV2API) GetPermissionLevels ¶ added in v0.84.0
func (a *UsersV2API) GetPermissionLevels(ctx context.Context, request GetPasswordPermissionLevelsRequest) (*GetPasswordPermissionLevelsResponse, error)
func (*UsersV2API) GetPermissions ¶ added in v0.84.0
func (a *UsersV2API) GetPermissions(ctx context.Context, request GetPasswordPermissionsRequest) (*PasswordPermissions, error)
func (*UsersV2API) List ¶ added in v0.84.0
Gets details for all the users associated with a Databricks workspace.
func (*UsersV2API) ListAll ¶ added in v0.84.0
func (a *UsersV2API) ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)
Gets details for all the users associated with a Databricks workspace.
func (*UsersV2API) Patch ¶ added in v0.84.0
func (a *UsersV2API) Patch(ctx context.Context, request PatchUserRequest) error
func (*UsersV2API) SetPermissions ¶ added in v0.84.0
func (a *UsersV2API) SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
func (*UsersV2API) Update ¶ added in v0.84.0
func (a *UsersV2API) Update(ctx context.Context, request UpdateUserRequest) error
func (*UsersV2API) UpdatePermissions ¶ added in v0.84.0
func (a *UsersV2API) UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
type UsersV2Interface ¶ added in v0.84.0
type UsersV2Interface interface {
// Creates a new user in the Databricks workspace. This new user will also be
// added to the Databricks account.
Create(ctx context.Context, request CreateUserRequest) (*User, error)
// Deletes a user. Deleting a user from a Databricks workspace also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteUserRequest) error
// Gets information for a specific user in Databricks workspace.
Get(ctx context.Context, request GetUserRequest) (*User, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetPasswordPermissionLevelsRequest) (*GetPasswordPermissionLevelsResponse, error)
// Gets the permissions of all passwords. Passwords can inherit permissions from
// their root object.
GetPermissions(ctx context.Context, request GetPasswordPermissionsRequest) (*PasswordPermissions, error)
// Gets details for all the users associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListUsersRequest) listing.Iterator[User]
// Gets details for all the users associated with a Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListUsersRequest) ([]User, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PatchUserRequest) error
// Sets permissions on an object, replacing existing permissions if they exist.
// Deletes all direct permissions if none are specified. Objects can inherit
// permissions from their root object.
SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request UpdateUserRequest) error
// Updates the permissions on all passwords. Passwords can inherit permissions
// from their root object.
UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
}
type UsersV2Service
deprecated
added in
v0.84.0
type UsersV2Service interface {
// Creates a new user in the Databricks workspace. This new user will also
// be added to the Databricks account.
Create(ctx context.Context, request CreateUserRequest) (*User, error)
// Deletes a user. Deleting a user from a Databricks workspace also removes
// objects associated with the user.
Delete(ctx context.Context, request DeleteUserRequest) error
// Gets information for a specific user in Databricks workspace.
Get(ctx context.Context, request GetUserRequest) (*User, error)
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetPasswordPermissionLevelsRequest) (*GetPasswordPermissionLevelsResponse, error)
// Gets the permissions of all passwords. Passwords can inherit permissions
// from their root object.
GetPermissions(ctx context.Context, request GetPasswordPermissionsRequest) (*PasswordPermissions, error)
// Gets details for all the users associated with a Databricks workspace.
List(ctx context.Context, request ListUsersRequest) (*ListUsersResponse, error)
// Partially updates a user resource by applying the supplied operations on
// specific user attributes.
Patch(ctx context.Context, request PatchUserRequest) error
// Sets permissions on an object, replacing existing permissions if they
// exist. Deletes all direct permissions if none are specified. Objects can
// inherit permissions from their root object.
SetPermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, error)
// Replaces a user's information with the data supplied in request.
Update(ctx context.Context, request UpdateUserRequest) error
// Updates the permissions on all passwords. Passwords can inherit
// permissions from their root object.
UpdatePermissions(ctx context.Context, request PasswordPermissionsRequest) (*PasswordPermissions, 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.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type WorkspaceAssignmentAPI ¶
type WorkspaceAssignmentAPI struct {
// contains filtered or unexported fields
}
The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.
func NewWorkspaceAssignment ¶
func NewWorkspaceAssignment(client *client.DatabricksClient) *WorkspaceAssignmentAPI
func (*WorkspaceAssignmentAPI) Delete ¶
func (a *WorkspaceAssignmentAPI) Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error
func (*WorkspaceAssignmentAPI) DeleteByWorkspaceIdAndPrincipalId ¶
func (a *WorkspaceAssignmentAPI) DeleteByWorkspaceIdAndPrincipalId(ctx context.Context, workspaceId int64, principalId int64) error
Deletes the workspace permissions assignment in a given account and workspace for the specified principal.
func (*WorkspaceAssignmentAPI) Get ¶
func (a *WorkspaceAssignmentAPI) Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error)
func (*WorkspaceAssignmentAPI) GetByWorkspaceId ¶
func (a *WorkspaceAssignmentAPI) GetByWorkspaceId(ctx context.Context, workspaceId int64) (*WorkspacePermissions, error)
Get an array of workspace permissions for the specified account and workspace.
func (*WorkspaceAssignmentAPI) List ¶ added in v0.24.0
func (a *WorkspaceAssignmentAPI) List(ctx context.Context, request ListWorkspaceAssignmentRequest) listing.Iterator[PermissionAssignment]
Get the permission assignments for the specified Databricks account and Databricks workspace.
Example (WorkspaceAssignmentOnAws) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
workspaceId := func(v string) int64 {
i, err := strconv.ParseInt(v, 10, 64)
if err != nil {
panic(fmt.Sprintf("`%s` is not int64: %s", v, err))
}
return i
}(os.Getenv("DUMMY_WORKSPACE_ID"))
all, err := a.WorkspaceAssignment.ListByWorkspaceId(ctx, workspaceId)
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", all)
func (*WorkspaceAssignmentAPI) ListAll ¶
func (a *WorkspaceAssignmentAPI) ListAll(ctx context.Context, request ListWorkspaceAssignmentRequest) ([]PermissionAssignment, error)
Get the permission assignments for the specified Databricks account and Databricks workspace.
func (*WorkspaceAssignmentAPI) ListByWorkspaceId ¶
func (a *WorkspaceAssignmentAPI) ListByWorkspaceId(ctx context.Context, workspaceId int64) (*PermissionAssignments, error)
Get the permission assignments for the specified Databricks account and Databricks workspace.
func (*WorkspaceAssignmentAPI) Update ¶
func (a *WorkspaceAssignmentAPI) Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error)
Example (WorkspaceAssignmentOnAws) ¶
ctx := context.Background()
a, err := databricks.NewAccountClient()
if err != nil {
panic(err)
}
spn, err := a.ServicePrincipals.Create(ctx, iam.ServicePrincipal{
DisplayName: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
panic(err)
}
logger.Infof(ctx, "found %v", spn)
spnId := func(v string) int64 {
i, err := strconv.ParseInt(v, 10, 64)
if err != nil {
panic(fmt.Sprintf("`%s` is not int64: %s", v, err))
}
return i
}(spn.Id)
workspaceId := func(v string) int64 {
i, err := strconv.ParseInt(v, 10, 64)
if err != nil {
panic(fmt.Sprintf("`%s` is not int64: %s", v, err))
}
return i
}(os.Getenv("DUMMY_WORKSPACE_ID"))
_, err = a.WorkspaceAssignment.Update(ctx, iam.UpdateWorkspaceAssignments{
WorkspaceId: workspaceId,
PrincipalId: spnId,
Permissions: []iam.WorkspacePermission{iam.WorkspacePermissionUser},
})
if err != nil {
panic(err)
}
type WorkspaceAssignmentInterface ¶ added in v0.29.0
type WorkspaceAssignmentInterface interface {
// Deletes the workspace permissions assignment in a given account and workspace
// for the specified principal.
Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error
// Deletes the workspace permissions assignment in a given account and workspace
// for the specified principal.
DeleteByWorkspaceIdAndPrincipalId(ctx context.Context, workspaceId int64, principalId int64) error
// Get an array of workspace permissions for the specified account and
// workspace.
Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error)
// Get an array of workspace permissions for the specified account and
// workspace.
GetByWorkspaceId(ctx context.Context, workspaceId int64) (*WorkspacePermissions, error)
// Get the permission assignments for the specified Databricks account and
// Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
List(ctx context.Context, request ListWorkspaceAssignmentRequest) listing.Iterator[PermissionAssignment]
// Get the permission assignments for the specified Databricks account and
// Databricks workspace.
//
// This method is generated by Databricks SDK Code Generator.
ListAll(ctx context.Context, request ListWorkspaceAssignmentRequest) ([]PermissionAssignment, error)
// Get the permission assignments for the specified Databricks account and
// Databricks workspace.
ListByWorkspaceId(ctx context.Context, workspaceId int64) (*PermissionAssignments, error)
// Creates or updates the workspace permissions assignment in a given account
// and workspace for the specified principal.
Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error)
}
type WorkspaceAssignmentService
deprecated
type WorkspaceAssignmentService interface {
// Deletes the workspace permissions assignment in a given account and
// workspace for the specified principal.
Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error
// Get an array of workspace permissions for the specified account and
// workspace.
Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error)
// Get the permission assignments for the specified Databricks account and
// Databricks workspace.
List(ctx context.Context, request ListWorkspaceAssignmentRequest) (*PermissionAssignments, error)
// Creates or updates the workspace permissions assignment in a given
// account and workspace for the specified principal.
Update(ctx context.Context, request UpdateWorkspaceAssignments) (*PermissionAssignment, error)
}
The Workspace Permission Assignment API allows you to manage workspace permissions for principals in your account.
Deprecated: Do not use this interface, it will be removed in a future version of the SDK.
type WorkspacePermission ¶
type WorkspacePermission string
const WorkspacePermissionAdmin WorkspacePermission = `ADMIN`
const WorkspacePermissionUnknown WorkspacePermission = `UNKNOWN`
const WorkspacePermissionUser WorkspacePermission = `USER`
func (*WorkspacePermission) Set ¶
func (f *WorkspacePermission) Set(v string) error
Set raw string value and validate it against allowed values
func (*WorkspacePermission) String ¶
func (f *WorkspacePermission) String() string
String representation for fmt.Print
func (*WorkspacePermission) Type ¶
func (f *WorkspacePermission) Type() string
Type always returns WorkspacePermission to satisfy [pflag.Value] interface
func (*WorkspacePermission) Values ¶ added in v0.72.0
func (f *WorkspacePermission) Values() []WorkspacePermission
Values returns all possible values for WorkspacePermission.
There is no guarantee on the order of the values in the slice.
type WorkspacePermissions ¶
type WorkspacePermissions struct {
// Array of permissions defined for a workspace.
Permissions []PermissionOutput `json:"permissions,omitempty"`
}