Documentation
¶
Index ¶
- Constants
- func GetAccountHostname(hostname string) string
- type APIError
- type AttrVars
- type Auth
- type BaseResponse
- type Client
- func (c *Client) CreateOrUpdateWorkspaceMember(ctx context.Context, workspaceId string, principalId string) (*v2.RateLimitDescription, error)
- func (c *Client) CreateUser(ctx context.Context, workspaceId string, body *CreateUserBody) (*CreateUserResponse, *v2.RateLimitDescription, error)
- func (c *Client) Delete(ctx context.Context, urlAddress *url.URL) (*v2.RateLimitDescription, error)
- func (c *Client) DeleteUser(ctx context.Context, workspaceId string, userId string) (*v2.RateLimitDescription, error)
- func (c *Client) FindGroupDisplayName(ctx context.Context, workspaceId, groupID string) (string, *v2.RateLimitDescription, error)
- func (c *Client) FindGroupID(ctx context.Context, workspaceId string, displayName string) (string, *v2.RateLimitDescription, error)
- func (c *Client) FindServicePrincipalAppID(ctx context.Context, workspaceId string, servicePrincipalID string) (string, *v2.RateLimitDescription, error)
- func (c *Client) FindServicePrincipalID(ctx context.Context, workspaceId string, appID string) (string, *v2.RateLimitDescription, error)
- func (c *Client) FindUserID(ctx context.Context, workspaceId string, username string) (string, *v2.RateLimitDescription, error)
- func (c *Client) FindUsername(ctx context.Context, workspaceId string, userID string) (string, *v2.RateLimitDescription, error)
- func (c *Client) Get(ctx context.Context, urlAddress *url.URL, response interface{}, params ...Vars) (*v2.RateLimitDescription, error)
- func (c *Client) GetAccountId() string
- func (c *Client) GetGroup(ctx context.Context, workspaceId, groupId string, vars ...Vars) (*Group, *v2.RateLimitDescription, error)
- func (c *Client) GetServicePrincipal(ctx context.Context, workspaceId string, servicePrincipalID string) (*ServicePrincipal, *v2.RateLimitDescription, error)
- func (c *Client) GetUser(ctx context.Context, workspaceId string, userId string) (*User, *v2.RateLimitDescription, error)
- func (c *Client) IsAccountAPIAvailable() bool
- func (c *Client) IsWorkspaceAPIAvailable() bool
- func (c *Client) ListGroups(ctx context.Context, workspaceId string, vars ...Vars) ([]Group, uint, *v2.RateLimitDescription, error)
- func (c *Client) ListRoles(ctx context.Context, workspaceId string, resourceType string, ...) ([]Role, *v2.RateLimitDescription, error)
- func (c *Client) ListRuleSets(ctx context.Context, workspaceId string, resourceType string, ...) ([]RuleSet, *v2.RateLimitDescription, error)
- func (c *Client) ListServicePrincipals(ctx context.Context, workspaceId string, vars ...Vars) ([]ServicePrincipal, uint, *v2.RateLimitDescription, error)
- func (c *Client) ListUsers(ctx context.Context, workspaceId string, vars ...Vars) ([]User, uint, *v2.RateLimitDescription, error)
- func (c *Client) ListWorkspaceMembers(ctx context.Context, workspaceId string) ([]WorkspaceAssignment, *v2.RateLimitDescription, error)
- func (c *Client) ListWorkspaces(ctx context.Context) ([]Workspace, *v2.RateLimitDescription, error)
- func (c *Client) Post(ctx context.Context, urlAddress *url.URL, body interface{}, ...) (*v2.RateLimitDescription, error)
- func (c *Client) Put(ctx context.Context, urlAddress *url.URL, body interface{}, ...) (*v2.RateLimitDescription, error)
- func (c *Client) RemoveWorkspaceMember(ctx context.Context, workspaceId string, principalId string) (*v2.RateLimitDescription, error)
- func (c *Client) UpdateAvailability(accAPI, wsAPI bool)
- func (c *Client) UpdateEtag(etag string)
- func (c *Client) UpdateGroup(ctx context.Context, workspaceId string, group *Group) (*v2.RateLimitDescription, error)
- func (c *Client) UpdateRuleSets(ctx context.Context, workspaceId, resourceType, resourceId string, ...) (*v2.RateLimitDescription, error)
- func (c *Client) UpdateServicePrincipal(ctx context.Context, workspaceId string, servicePrincipal *ServicePrincipal) (*v2.RateLimitDescription, error)
- func (c *Client) UpdateUser(ctx context.Context, workspaceId string, user *User) (*v2.RateLimitDescription, error)
- type CreateUserBody
- type CreateUserResponse
- type FilterVars
- type Group
- type ListResponse
- type Member
- type Name
- type NameVars
- type NoAuth
- type OAuth2
- type PaginationVars
- type PermissionValue
- type Permissions
- type ResourceVars
- type Role
- type RuleSet
- type ServicePrincipal
- type User
- type Vars
- type Workspace
- type WorkspaceAssignment
- type WorkspacePrincipal
Constants ¶
View Source
const (
AlreadyExists = "AlreadyExists"
)
Variables ¶
This section is empty.
Functions ¶
func GetAccountHostname ¶ added in v0.0.9
Types ¶
type AttrVars ¶
type AttrVars struct {
Attrs []string `json:"attributes"`
}
Attribute vars are used to specify which attributes to return from the API.
func NewGroupAttrVars ¶
func NewGroupAttrVars() *AttrVars
func NewGroupMembersAttrVars ¶ added in v0.1.5
func NewGroupMembersAttrVars() *AttrVars
func NewGroupRolesAttrVars ¶
func NewGroupRolesAttrVars() *AttrVars
func NewServicePrincipalAttrVars ¶
func NewServicePrincipalAttrVars() *AttrVars
func NewServicePrincipalRolesAttrVars ¶
func NewServicePrincipalRolesAttrVars() *AttrVars
func NewUserAttrVars ¶
func NewUserAttrVars() *AttrVars
func NewUserRolesAttrVars ¶
func NewUserRolesAttrVars() *AttrVars
type BaseResponse ¶
type BaseResponse struct {
ID string `json:"id"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateOrUpdateWorkspaceMember ¶
func (*Client) CreateUser ¶ added in v0.0.17
func (c *Client) CreateUser( ctx context.Context, workspaceId string, body *CreateUserBody, ) ( *CreateUserResponse, *v2.RateLimitDescription, error, )
func (*Client) DeleteUser ¶ added in v0.0.17
func (*Client) FindGroupDisplayName ¶
func (*Client) FindGroupID ¶
func (*Client) FindServicePrincipalAppID ¶
func (*Client) FindServicePrincipalID ¶
func (*Client) FindUserID ¶
func (*Client) FindUsername ¶
func (*Client) GetAccountId ¶
func (*Client) GetServicePrincipal ¶
func (c *Client) GetServicePrincipal( ctx context.Context, workspaceId string, servicePrincipalID string, ) ( *ServicePrincipal, *v2.RateLimitDescription, error, )
func (*Client) IsAccountAPIAvailable ¶
func (*Client) IsWorkspaceAPIAvailable ¶
func (*Client) ListGroups ¶
func (*Client) ListRuleSets ¶
func (*Client) ListServicePrincipals ¶
func (c *Client) ListServicePrincipals( ctx context.Context, workspaceId string, vars ...Vars, ) ( []ServicePrincipal, uint, *v2.RateLimitDescription, error, )
func (*Client) ListWorkspaceMembers ¶
func (c *Client) ListWorkspaceMembers( ctx context.Context, workspaceId string, ) ( []WorkspaceAssignment, *v2.RateLimitDescription, error, )
func (*Client) ListWorkspaces ¶
func (*Client) RemoveWorkspaceMember ¶
func (*Client) UpdateAvailability ¶
func (*Client) UpdateEtag ¶
func (*Client) UpdateGroup ¶
func (*Client) UpdateRuleSets ¶
func (*Client) UpdateServicePrincipal ¶
func (c *Client) UpdateServicePrincipal( ctx context.Context, workspaceId string, servicePrincipal *ServicePrincipal, ) ( *v2.RateLimitDescription, error, )
func (*Client) UpdateUser ¶
type CreateUserBody ¶ added in v0.0.17
type CreateUserBody struct {
// this is actually the email:
// https://docs.databricks.com/api/account/accountusers/create#userName
UserName string `json:"userName"`
Name Name `json:"name"`
Id string `json:"id,omitempty"` // Not currently supported, reserved for future use.
Active bool `json:"active"`
DisplayName string `json:"displayName"`
}
type CreateUserResponse ¶ added in v0.0.17
type CreateUserResponse CreateUserBody
type FilterVars ¶
type FilterVars struct {
Filter string `json:"filter"`
}
Filter vars are used for filtering results from the API.
func NewFilterVars ¶
func NewFilterVars(filter string) *FilterVars
func (*FilterVars) Apply ¶
func (f *FilterVars) Apply(params *url.Values)
type Group ¶
type Group struct {
BaseResponse
Permissions
DisplayName string `json:"displayName"`
Members []Member `json:"members,omitempty"`
Meta struct {
Type string `json:"resourceType"`
} `json:"meta,omitempty"`
Schemas []string `json:"schemas,omitempty"`
}
func (Group) HaveEntitlement ¶
func (Group) IsAccountGroup ¶
type ListResponse ¶
type NameVars ¶
func NewNameVars ¶
type PaginationVars ¶
Pagination vars are used for paginating results from the API.
func NewPaginationVars ¶
func NewPaginationVars(start uint, count uint) *PaginationVars
func (*PaginationVars) Apply ¶
func (p *PaginationVars) Apply(params *url.Values)
type PermissionValue ¶
type PermissionValue struct {
Value string `json:"value"`
}
type Permissions ¶
type Permissions struct {
Roles []PermissionValue `json:"roles,omitempty"`
Entitlements []PermissionValue `json:"entitlements,omitempty"`
}
type ResourceVars ¶
type ResourceVars struct {
Payload string `json:"resource"`
}
func NewResourceVars ¶
func NewResourceVars(resource string) *ResourceVars
func (*ResourceVars) Apply ¶
func (r *ResourceVars) Apply(params *url.Values)
type ServicePrincipal ¶
type ServicePrincipal struct {
BaseResponse
Permissions
DisplayName string `json:"displayName"`
Active bool `json:"active"`
ApplicationID string `json:"applicationId"`
}
func (ServicePrincipal) HaveEntitlement ¶
func (s ServicePrincipal) HaveEntitlement(entitlement string) bool
func (ServicePrincipal) HaveRole ¶
func (s ServicePrincipal) HaveRole(role string) bool
type User ¶
type User struct {
BaseResponse
Permissions
Emails []struct {
Primary bool `json:"primary"`
Value string `json:"value"`
} `json:"emails"`
UserName string `json:"userName"`
DisplayName string `json:"displayName"`
Active bool `json:"active,omitempty"`
}
func (User) HaveEntitlement ¶
type WorkspaceAssignment ¶
type WorkspaceAssignment struct {
Principal *WorkspacePrincipal `json:"principal"`
}
Click to show internal directories.
Click to hide internal directories.