workspace

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Source  ExportFormat = "SOURCE"
	HTML    ExportFormat = "HTML"
	Jupyter ExportFormat = "JUPYTER"
	DBC     ExportFormat = "DBC"

	Scala  Language = "SCALA"
	Python Language = "PYTHON"
	SQL    Language = "SQL"
	R      Language = "R"

	Notebook      ObjectType = "NOTEBOOK"
	Directory     ObjectType = "DIRECTORY"
	LibraryObject ObjectType = "LIBRARY"
)

...

Variables

This section is empty.

Functions

func DataSourceNotebook

func DataSourceNotebook() *schema.Resource

DataSourceNotebook ...

func DataSourceNotebookPaths

func DataSourceNotebookPaths() *schema.Resource

DataSourceNotebookPaths ...

func FileContentSchema added in v0.3.0

func FileContentSchema(extra map[string]*schema.Schema) map[string]*schema.Schema

FileContentSchema returns common schema for file resources

func MigrateV0 added in v0.3.0

func MigrateV0(ctx context.Context,
	rawState map[string]interface{},
	meta interface{}) (map[string]interface{}, error)

MigrateV0 migrates from version 0.2.x state

func PathListHash added in v0.3.0

func PathListHash(v interface{}) int

PathListHash ...

func ReadContent added in v0.3.0

func ReadContent(d *schema.ResourceData) (content []byte, err error)

ReadContent to work with `content_base64` and `source` properties accordingly and set MD5 checksum

func ResourceNotebook

func ResourceNotebook() *schema.Resource

ResourceNotebook manages notebooks

func ResourceWorkspaceConf added in v0.2.8

func ResourceWorkspaceConf() *schema.Resource

ResourceWorkspaceConf maintains workspace configuration for specified keys

Types

type ExportFormat

type ExportFormat string

ExportFormat is a custom type for formats in which you can export Databricks workspace components

type ImportRequest added in v0.3.0

type ImportRequest struct {
	Content   string `json:"content"`
	Path      string `json:"path"`
	Language  string `json:"language,omitempty"`
	Format    string `json:"format,omitempty"`
	Overwrite bool   `json:"overwrite,omitempty"`
}

ImportRequest contains the payload to import a notebook

type Language

type Language string

Language is a custom type for language types in Databricks notebooks

type NotebookContent

type NotebookContent struct {
	Content string `json:"content,omitempty"`
}

NotebookContent contains the base64 content of the notebook

type NotebookDeleteRequest

type NotebookDeleteRequest struct {
	Path      string `json:"path,omitempty"`
	Recursive bool   `json:"recursive,omitempty"`
}

NotebookDeleteRequest contains the payload to delete a notebook

type NotebooksAPI

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

NotebooksAPI exposes the Notebooks API

func NewNotebooksAPI

func NewNotebooksAPI(ctx context.Context, m interface{}) NotebooksAPI

NewNotebooksAPI creates NotebooksAPI instance from provider meta

func (NotebooksAPI) Create

func (a NotebooksAPI) Create(r ImportRequest) 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 ExportFormat) (string, error)

Export returns the notebook content as a base64 string

func (NotebooksAPI) List

func (a NotebooksAPI) List(path string, recursive 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) 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 ObjectStatus added in v0.3.0

type ObjectStatus struct {
	ObjectID   int64      `json:"object_id,omitempty" tf:"computed"`
	ObjectType ObjectType `json:"object_type,omitempty" tf:"computed"`
	Path       string     `json:"path"`
	Language   Language   `json:"language,omitempty"`
}

ObjectStatus contains information when doing a get request or list request on the workspace api

type ObjectType

type ObjectType string

ObjectType is a custom type for object types in Databricks workspaces

type WorkspaceConfAPI added in v0.2.8

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

WorkspaceConfAPI exposes the workspace configurations API

func NewWorkspaceConfAPI added in v0.2.8

func NewWorkspaceConfAPI(ctx context.Context, m interface{}) WorkspaceConfAPI

NewWorkspaceConfAPI returns workspace conf API

func (WorkspaceConfAPI) Read added in v0.2.8

func (a WorkspaceConfAPI) Read(conf *map[string]interface{}) error

Read just returns back a map of keys and values which keys are the configuration items and values are the settings

func (WorkspaceConfAPI) Update added in v0.2.8

func (a WorkspaceConfAPI) Update(workspaceConfMap map[string]interface{}) error

Update will handle creation of new values as well as deletes. Deleting just implies that a value of "" or the appropriate disable string like "false" is sent with the appropriate key

Jump to

Keyboard shortcuts

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