Documentation ¶
Index ¶
- Constants
- func DataSourceDirectory() common.Resource
- func DataSourceNotebook() common.Resource
- func DataSourceNotebookPaths() common.Resource
- func FileContentSchema(extra map[string]*schema.Schema) map[string]*schema.Schema
- func FileContentSchemaWithoutPath(extra map[string]*schema.Schema) map[string]*schema.Schema
- func MigrateV0(ctx context.Context, rawState map[string]any, meta any) (map[string]any, error)
- func PathListHash(v any) int
- func ReadContent(d *schema.ResourceData) (content []byte, err error)
- func ResourceDirectory() common.Resource
- func ResourceGlobalInitScript() common.Resource
- func ResourceNotebook() common.Resource
- func ResourceWorkspaceConf() common.Resource
- func ResourceWorkspaceFile() common.Resource
- func SafeGetStatus(ctx context.Context, w *databricks.WorkspaceClient, keys []string) (map[string]string, error)
- func SafeSetStatus(ctx context.Context, w *databricks.WorkspaceClient, ...) error
- type DeletePath
- type ExportPath
- type ImportPath
- type ModifiedAtInteractive
- type NotebooksAPI
- func (a NotebooksAPI) Create(r ImportPath) error
- func (a NotebooksAPI) Delete(path string, recursive bool) error
- func (a NotebooksAPI) Export(path string, format string) (string, error)
- func (a NotebooksAPI) GetStatus(path string, returnGitInfo bool) (ObjectStatus, error)
- func (a NotebooksAPI) List(path string, recursive bool, ignoreErrors bool) ([]ObjectStatus, error)
- func (a NotebooksAPI) ListInternalImpl(path string) ([]ObjectStatus, error)
- func (a NotebooksAPI) Mkdirs(path string) error
- func (a NotebooksAPI) Read(path string) (ObjectStatus, error)
- type ObjectList
- type ObjectStatus
Constants ¶
const ( Notebook string = "NOTEBOOK" File string = "FILE" Directory string = "DIRECTORY" Repo string = "REPO" Scala string = "SCALA" Python string = "PYTHON" SQL string = "SQL" R string = "R" Jupyter string = "JUPYTER" Auto string = "AUTO" )
...
Variables ¶
This section is empty.
Functions ¶
func DataSourceDirectory ¶ added in v1.8.0
DataSourceDirectory ...
func DataSourceNotebookPaths ¶
DataSourceNotebookPaths ...
func FileContentSchema ¶
FileContentSchema returns common schema for file resources
func FileContentSchemaWithoutPath ¶
FileContentSchemaWithoutPath returns common schema for file resources, but without path
func ReadContent ¶
func ReadContent(d *schema.ResourceData) (content []byte, err error)
ReadContent to work with `content_base64` and `source` properties accordingly and set MD5 checksum
func ResourceDirectory ¶
ResourceDirectory manages directories
func ResourceGlobalInitScript ¶
ResourceGlobalInitScript manages notebooks
func ResourceWorkspaceConf ¶
ResourceWorkspaceConf maintains workspace configuration for specified keys
func ResourceWorkspaceFile ¶ added in v1.16.0
ResourceWorkspaceFile manages files in workspace
func SafeGetStatus ¶ added in v1.54.0
func SafeGetStatus(ctx context.Context, w *databricks.WorkspaceClient, keys []string) (map[string]string, error)
SafeGetStatus is a wrapper around the GetStatus API that tolerates invalid keys. If any of the provided keys are not valid, the GetStatus API is called again with only the valid keys. If all keys are invalid, an error is returned.
func SafeSetStatus ¶ added in v1.54.0
func SafeSetStatus(ctx context.Context, w *databricks.WorkspaceClient, removed map[string]struct{}, newConf map[string]string) error
SafeSetStatus is a wrapper around the SetStatus API that tolerates invalid keys. If any of the provided keys are not valid, the removed map is checked to see if those keys are being removed. If all keys are being removed, the error is ignored. Otherwise, an error is returned.
Types ¶
type DeletePath ¶
type DeletePath struct { Path string `json:"path,omitempty"` Recursive bool `json:"recursive,omitempty"` }
DeletePath contains the payload to delete a notebook
type ExportPath ¶
type ExportPath struct {
Content string `json:"content,omitempty"`
}
ExportPath contains the base64 content of the notebook
type ImportPath ¶
type ImportPath struct { Content string `json:"content"` Path string `json:"path"` Language string `json:"language,omitempty"` Format string `json:"format,omitempty"` Overwrite bool `json:"overwrite,omitempty"` }
ImportPath contains the payload to import a notebook
type ModifiedAtInteractive ¶ added in v1.24.0
type NotebooksAPI ¶
type NotebooksAPI struct {
// contains filtered or unexported fields
}
NotebooksAPI exposes the Notebooks API
func NewNotebooksAPI ¶
func NewNotebooksAPI(ctx context.Context, m any) NotebooksAPI
NewNotebooksAPI creates NotebooksAPI instance from provider meta
func (NotebooksAPI) Create ¶
func (a NotebooksAPI) Create(r ImportPath) error
Create creates a notebook given the content and path
func (NotebooksAPI) Delete ¶
func (a NotebooksAPI) Delete(path string, recursive bool) error
Delete will delete folders given a path and recursive flag
func (NotebooksAPI) Export ¶
func (a NotebooksAPI) Export(path string, format string) (string, error)
Export returns the notebook content as a base64 string
func (NotebooksAPI) GetStatus ¶ added in v1.62.0
func (a NotebooksAPI) GetStatus(path string, returnGitInfo bool) (ObjectStatus, error)
Read returns the notebook metadata and not the contents
func (NotebooksAPI) List ¶
func (a NotebooksAPI) List(path string, recursive bool, ignoreErrors bool) ([]ObjectStatus, error)
List will list all objects in a path on the workspace and with the recursive flag it will recursively list all the objects
func (NotebooksAPI) ListInternalImpl ¶ added in v1.36.0
func (a NotebooksAPI) ListInternalImpl(path string) ([]ObjectStatus, error)
func (NotebooksAPI) Mkdirs ¶
func (a NotebooksAPI) Mkdirs(path string) error
Mkdirs will make folders in a workspace recursively given a path
func (NotebooksAPI) Read ¶
func (a NotebooksAPI) Read(path string) (ObjectStatus, error)
Read returns the notebook metadata and not the contents
type ObjectList ¶
type ObjectList struct {
Objects []ObjectStatus `json:"objects,omitempty"`
}
type ObjectStatus ¶
type ObjectStatus struct { ObjectID int64 `json:"object_id,omitempty" tf:"computed"` ObjectType string `json:"object_type,omitempty" tf:"computed"` Path string `json:"path"` Language string `json:"language,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` ModifiedAt int64 `json:"modified_at,omitempty"` ModifiedAtInteractive *ModifiedAtInteractive `json:"modified_at_interactive,omitempty"` Size int64 `json:"size,omitempty"` GitInfo *workspace.RepoInfo `json:"git_info,omitempty"` ResourceId string `json:"resource_id,omitempty"` }
ObjectStatus contains information when doing a get request or list request on the workspace api