Documentation
¶
Index ¶
- type AccessControlRequest
- type AccessControlResponse
- type CreateWorkspaceAssignments
- type DeleteWorkspaceAssignmentRequest
- type Get
- type GetPermissionLevels
- type GetPermissionLevelsResponse
- type GetWorkspaceAssignmentRequest
- type ListWorkspaceAssignmentRequest
- type ObjectPermissions
- type Permission
- type PermissionAssignment
- type PermissionAssignmentInput
- type PermissionAssignments
- type PermissionLevel
- type PermissionOutput
- type PermissionsAPI
- func (a *PermissionsAPI) Get(ctx context.Context, request Get) (*ObjectPermissions, error)
- func (a *PermissionsAPI) GetByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*ObjectPermissions, error)
- func (a *PermissionsAPI) GetPermissionLevels(ctx context.Context, request GetPermissionLevels) (*GetPermissionLevelsResponse, error)
- func (a *PermissionsAPI) GetPermissionLevelsByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*GetPermissionLevelsResponse, error)
- func (a *PermissionsAPI) Impl() PermissionsService
- func (a *PermissionsAPI) Set(ctx context.Context, request PermissionsRequest) error
- func (a *PermissionsAPI) Update(ctx context.Context, request PermissionsRequest) error
- func (a *PermissionsAPI) WithImpl(impl PermissionsService) *PermissionsAPI
- type PermissionsDescription
- type PermissionsRequest
- type PermissionsService
- type PrincipalOutput
- type UpdateWorkspaceAssignments
- type WorkspaceAssignmentAPI
- func (a *WorkspaceAssignmentAPI) Create(ctx context.Context, request CreateWorkspaceAssignments) (*WorkspaceAssignmentsCreated, error)
- 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) Impl() WorkspaceAssignmentService
- 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) error
- func (a *WorkspaceAssignmentAPI) WithImpl(impl WorkspaceAssignmentService) *WorkspaceAssignmentAPI
- type WorkspaceAssignmentService
- type WorkspaceAssignmentsCreated
- type WorkspacePermission
- type WorkspacePermissions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControlRequest ¶
type AccessControlRequest struct {
// name of the group
GroupName string `json:"group_name,omitempty"`
// Permission level
PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
// name of the service principal
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// name of the user
UserName string `json:"user_name,omitempty"`
}
type AccessControlResponse ¶
type AccessControlResponse struct {
// All permissions.
AllPermissions []Permission `json:"all_permissions,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"`
}
type CreateWorkspaceAssignments ¶
type CreateWorkspaceAssignments struct {
// Array of permissions assignments to apply to a workspace.
PermissionAssignments []PermissionAssignmentInput `json:"permission_assignments,omitempty"`
// The workspace ID for the account.
WorkspaceId int64 `json:"-" url:"-"`
}
type DeleteWorkspaceAssignmentRequest ¶
type DeleteWorkspaceAssignmentRequest struct {
// The ID of the service principal.
PrincipalId int64 `json:"-" url:"-"`
// The workspace ID.
WorkspaceId int64 `json:"-" url:"-"`
}
Delete permissions assignment
type Get ¶
type Get struct {
RequestObjectId string `json:"-" url:"-"`
// <needs content>
RequestObjectType string `json:"-" url:"-"`
}
Get object permissions
type GetPermissionLevels ¶
type GetPermissionLevels struct {
// <needs content>
RequestObjectId string `json:"-" url:"-"`
// <needs content>
RequestObjectType string `json:"-" url:"-"`
}
Get permission levels
type GetPermissionLevelsResponse ¶
type GetPermissionLevelsResponse struct {
// Specific permission levels
PermissionLevels []PermissionsDescription `json:"permission_levels,omitempty"`
}
type GetWorkspaceAssignmentRequest ¶
type GetWorkspaceAssignmentRequest struct {
// The workspace ID.
WorkspaceId int64 `json:"-" url:"-"`
}
List workspace permissions
type ListWorkspaceAssignmentRequest ¶
type ListWorkspaceAssignmentRequest struct {
// The workspace ID for the account.
WorkspaceId int64 `json:"-" url:"-"`
}
Get permission assignments
type ObjectPermissions ¶
type ObjectPermissions struct {
AccessControlList []AccessControlResponse `json:"access_control_list,omitempty"`
ObjectId string `json:"object_id,omitempty"`
ObjectType string `json:"object_type,omitempty"`
}
type Permission ¶
type Permission struct {
Inherited bool `json:"inherited,omitempty"`
InheritedFromObject []string `json:"inherited_from_object,omitempty"`
// Permission level
PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
}
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 service principal.
Permissions []WorkspacePermission `json:"permissions,omitempty"`
// Information about the service principal assigned for the workspace.
Principal *PrincipalOutput `json:"principal,omitempty"`
}
type PermissionAssignmentInput ¶
type PermissionAssignmentInput struct {
// The group name for the service principal.
GroupName string `json:"group_name,omitempty"`
// Array of permissions to apply to the workspace for the service principal.
Permissions []WorkspacePermission `json:"permissions,omitempty"`
// The name of the service principal.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// The username of the owner of the service principal.
UserName string `json:"user_name,omitempty"`
}
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 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 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`
type PermissionOutput ¶
type PermissionOutput struct {
// The results of a permissions query.
Description string `json:"description,omitempty"`
PermissionLevel WorkspacePermission `json:"permission_level,omitempty"`
}
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.
func NewPermissions ¶
func NewPermissions(client *client.DatabricksClient) *PermissionsAPI
func (*PermissionsAPI) Get ¶
func (a *PermissionsAPI) Get(ctx context.Context, request Get) (*ObjectPermissions, error)
Get object permissions
Gets the permission of an object. Objects can inherit permissions from their parent objects or root objects.
func (*PermissionsAPI) GetByRequestObjectTypeAndRequestObjectId ¶
func (a *PermissionsAPI) GetByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*ObjectPermissions, error)
Get object permissions
Gets the permission of an object. Objects can inherit permissions from their parent objects or root objects.
func (*PermissionsAPI) GetPermissionLevels ¶
func (a *PermissionsAPI) GetPermissionLevels(ctx context.Context, request GetPermissionLevels) (*GetPermissionLevelsResponse, error)
Get permission levels
Gets the permission levels that a user can have on an object.
func (*PermissionsAPI) GetPermissionLevelsByRequestObjectTypeAndRequestObjectId ¶
func (a *PermissionsAPI) GetPermissionLevelsByRequestObjectTypeAndRequestObjectId(ctx context.Context, requestObjectType string, requestObjectId string) (*GetPermissionLevelsResponse, error)
Get permission levels
Gets the permission levels that a user can have on an object.
func (*PermissionsAPI) Impl ¶
func (a *PermissionsAPI) Impl() PermissionsService
Impl returns low-level Permissions API implementation
func (*PermissionsAPI) Set ¶
func (a *PermissionsAPI) Set(ctx context.Context, request PermissionsRequest) error
Set permissions
Sets permissions on object. Objects can inherit permissions from their parent objects and root objects.
func (*PermissionsAPI) Update ¶
func (a *PermissionsAPI) Update(ctx context.Context, request PermissionsRequest) error
Update permission
Updates the permissions on an object.
func (*PermissionsAPI) WithImpl ¶
func (a *PermissionsAPI) WithImpl(impl PermissionsService) *PermissionsAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type PermissionsDescription ¶
type PermissionsDescription struct {
Description string `json:"description,omitempty"`
// Permission level
PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
}
type PermissionsRequest ¶
type PermissionsRequest struct {
AccessControlList []AccessControlRequest `json:"access_control_list,omitempty"`
RequestObjectId string `json:"-" url:"-"`
// <needs content>
RequestObjectType string `json:"-" url:"-"`
}
type PermissionsService ¶
type PermissionsService interface {
// Get object permissions
//
// Gets the permission of an object. Objects can inherit permissions from
// their parent objects or root objects.
Get(ctx context.Context, request Get) (*ObjectPermissions, error)
// Get permission levels
//
// Gets the permission levels that a user can have on an object.
GetPermissionLevels(ctx context.Context, request GetPermissionLevels) (*GetPermissionLevelsResponse, error)
// Set permissions
//
// Sets permissions on object. Objects can inherit permissions from their
// parent objects and root objects.
Set(ctx context.Context, request PermissionsRequest) error
// Update permission
//
// Updates the permissions on an object.
Update(ctx context.Context, request PermissionsRequest) error
}
Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints.
type PrincipalOutput ¶
type PrincipalOutput struct {
// The display name of the service principal.
DisplayName string `json:"display_name,omitempty"`
// The group name for the service principal.
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.
ServicePrincipalName string `json:"service_principal_name,omitempty"`
// The username of the owner of the service principal.
UserName string `json:"user_name,omitempty"`
}
type UpdateWorkspaceAssignments ¶
type UpdateWorkspaceAssignments struct {
// Array of permissions assignments to update on the workspace.
Permissions []WorkspacePermission `json:"permissions,omitempty"`
// The ID of the service principal.
PrincipalId int64 `json:"-" url:"-"`
// The workspace ID.
WorkspaceId int64 `json:"-" url:"-"`
}
type WorkspaceAssignmentAPI ¶
type WorkspaceAssignmentAPI struct {
// contains filtered or unexported fields
}
Databricks Workspace Assignment REST API
func NewWorkspaceAssignment ¶
func NewWorkspaceAssignment(client *client.DatabricksClient) *WorkspaceAssignmentAPI
func (*WorkspaceAssignmentAPI) Create ¶
func (a *WorkspaceAssignmentAPI) Create(ctx context.Context, request CreateWorkspaceAssignments) (*WorkspaceAssignmentsCreated, error)
Create permission assignments
Create new permission assignments for the specified account and workspace.
func (*WorkspaceAssignmentAPI) Delete ¶
func (a *WorkspaceAssignmentAPI) Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error
Delete permissions assignment
Deletes the workspace permissions assignment for a given account and workspace using the specified service principal.
func (*WorkspaceAssignmentAPI) DeleteByWorkspaceIdAndPrincipalId ¶
func (a *WorkspaceAssignmentAPI) DeleteByWorkspaceIdAndPrincipalId(ctx context.Context, workspaceId int64, principalId int64) error
Delete permissions assignment
Deletes the workspace permissions assignment for a given account and workspace using the specified service principal.
func (*WorkspaceAssignmentAPI) Get ¶
func (a *WorkspaceAssignmentAPI) Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error)
List workspace permissions
Get an array of workspace permissions for the specified account and workspace.
func (*WorkspaceAssignmentAPI) GetByWorkspaceId ¶
func (a *WorkspaceAssignmentAPI) GetByWorkspaceId(ctx context.Context, workspaceId int64) (*WorkspacePermissions, error)
List workspace permissions
Get an array of workspace permissions for the specified account and workspace.
func (*WorkspaceAssignmentAPI) Impl ¶
func (a *WorkspaceAssignmentAPI) Impl() WorkspaceAssignmentService
Impl returns low-level WorkspaceAssignment API implementation
func (*WorkspaceAssignmentAPI) ListAll ¶
func (a *WorkspaceAssignmentAPI) ListAll(ctx context.Context, request ListWorkspaceAssignmentRequest) ([]PermissionAssignment, error)
Get permission assignments
Get the permission assignments for the specified Databricks Account and Databricks Workspace.
This method is generated by Databricks SDK Code Generator.
func (*WorkspaceAssignmentAPI) ListByWorkspaceId ¶
func (a *WorkspaceAssignmentAPI) ListByWorkspaceId(ctx context.Context, workspaceId int64) (*PermissionAssignments, error)
Get permission assignments
Get the permission assignments for the specified Databricks Account and Databricks Workspace.
func (*WorkspaceAssignmentAPI) Update ¶
func (a *WorkspaceAssignmentAPI) Update(ctx context.Context, request UpdateWorkspaceAssignments) error
Update permissions assignment
Updates the workspace permissions assignment for a given account and workspace using the specified service principal.
func (*WorkspaceAssignmentAPI) WithImpl ¶
func (a *WorkspaceAssignmentAPI) WithImpl(impl WorkspaceAssignmentService) *WorkspaceAssignmentAPI
WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.
type WorkspaceAssignmentService ¶
type WorkspaceAssignmentService interface {
// Create permission assignments
//
// Create new permission assignments for the specified account and
// workspace.
Create(ctx context.Context, request CreateWorkspaceAssignments) (*WorkspaceAssignmentsCreated, error)
// Delete permissions assignment
//
// Deletes the workspace permissions assignment for a given account and
// workspace using the specified service principal.
Delete(ctx context.Context, request DeleteWorkspaceAssignmentRequest) error
// List workspace permissions
//
// Get an array of workspace permissions for the specified account and
// workspace.
Get(ctx context.Context, request GetWorkspaceAssignmentRequest) (*WorkspacePermissions, error)
// Get permission assignments
//
// Get the permission assignments for the specified Databricks Account and
// Databricks Workspace.
//
// Use ListAll() to get all PermissionAssignment instances
List(ctx context.Context, request ListWorkspaceAssignmentRequest) (*PermissionAssignments, error)
// Update permissions assignment
//
// Updates the workspace permissions assignment for a given account and
// workspace using the specified service principal.
Update(ctx context.Context, request UpdateWorkspaceAssignments) error
}
Databricks Workspace Assignment REST API
type WorkspaceAssignmentsCreated ¶
type WorkspaceAssignmentsCreated struct {
// Array of permissions assignments applied to a workspace.
PermissionAssignments []PermissionAssignment `json:"permission_assignments,omitempty"`
}
type WorkspacePermission ¶
type WorkspacePermission string
const WorkspacePermissionAdmin WorkspacePermission = `ADMIN`
const WorkspacePermissionUnknown WorkspacePermission = `UNKNOWN`
const WorkspacePermissionUser WorkspacePermission = `USER`
type WorkspacePermissions ¶
type WorkspacePermissions struct {
// Array of permissions defined for a workspace.
Permissions []PermissionOutput `json:"permissions,omitempty"`
}