workspace

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Notebook  string = "NOTEBOOK"
	Directory string = "DIRECTORY"
	Scala     string = "SCALA"
	Python    string = "PYTHON"
	SQL       string = "SQL"
	R         string = "R"
	Jupyter   string = "JUPYTER"
)

...

Variables

This section is empty.

Functions

func DataSourceDirectory added in v1.8.0

func DataSourceDirectory() *schema.Resource

DataSourceDirectory ...

func DataSourceNotebook

func DataSourceNotebook() *schema.Resource

DataSourceNotebook ...

func DataSourceNotebookPaths

func DataSourceNotebookPaths() *schema.Resource

DataSourceNotebookPaths ...

func FileContentSchema

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

FileContentSchema returns common schema for file resources

func FileContentSchemaWithoutPath

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

FileContentSchemaWithoutPath returns common schema for file resources, but without path

func MigrateV0

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

MigrateV0 migrates from version 0.2.x state

func PathListHash

func PathListHash(v any) int

PathListHash ...

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

func ResourceDirectory() *schema.Resource

ResourceDirectory manages directories

func ResourceGlobalInitScript

func ResourceGlobalInitScript() *schema.Resource

ResourceGlobalInitScript manages notebooks

func ResourceNotebook

func ResourceNotebook() *schema.Resource

ResourceNotebook manages notebooks

func ResourceWorkspaceConf

func ResourceWorkspaceConf() *schema.Resource

ResourceWorkspaceConf maintains workspace configuration for specified keys

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 GlobalInitScriptInfo

type GlobalInitScriptInfo struct {
	ScriptID      string `json:"script_id"`
	Name          string `json:"name"`
	Position      int32  `json:"position,omitempty" tf:"computed"`
	Enabled       bool   `json:"enabled,omitempty"`
	CreatedBy     string `json:"creator_user_name,omitempty"`
	CreatedAt     int64  `json:"created_at_timestamp,omitempty"`
	UpdatedBy     string `json:"updater_user_name,omitempty"`
	UpdatedAt     int64  `json:"updated_at_timestamp,omitempty"`
	ContentBase64 string `json:"script,omitempty"`
}

GlobalInitScriptInfo contains information about registered global init script

type GlobalInitScriptPayload

type GlobalInitScriptPayload struct {
	Name          string `json:"name"`
	Position      int32  `json:"position"`
	Enabled       bool   `json:"enabled"`
	ContentBase64 string `json:"script"`
}

GlobalInitScriptPayload contains information about registered global init script

type GlobalInitScriptsAPI

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

GlobalInitScriptsAPI exposes the Global Init Scripts API: https://docs.databricks.com/dev-tools/api/latest/global-init-scripts.html#

func NewGlobalInitScriptsAPI

func NewGlobalInitScriptsAPI(ctx context.Context, m any) GlobalInitScriptsAPI

NewGlobalInitScriptsAPI creates GlobalInitScriptsAPI instance from provider meta

func (GlobalInitScriptsAPI) Create

Create creates the global init script from the given payload.

func (GlobalInitScriptsAPI) Delete

func (a GlobalInitScriptsAPI) Delete(scriptID string) error

Delete deletes specific global init scripts

func (GlobalInitScriptsAPI) Get

func (a GlobalInitScriptsAPI) Get(scriptID string) (initScript GlobalInitScriptInfo, err error)

Get returns information about specific global init scripts

func (GlobalInitScriptsAPI) List

List returns a list of registered global init scripts

func (GlobalInitScriptsAPI) Update

func (a GlobalInitScriptsAPI) Update(scriptID string, payload GlobalInitScriptPayload) error

Update updates the specific global init script from the given payload.

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 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) 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) ListDirectories added in v1.11.0

func (a NotebooksAPI) ListDirectories(path string, recursive bool) ([]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"`
}

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

Jump to

Keyboard shortcuts

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