1. Packages
  2. Databricks Provider
  3. API Docs
  4. getNotebook
Databricks v1.65.0 published on Wednesday, Apr 9, 2025 by Pulumi

databricks.getNotebook

Explore with Pulumi AI

Databricks v1.65.0 published on Wednesday, Apr 9, 2025 by Pulumi

Note If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.

This data source allows to export a notebook from Databricks Workspace.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const features = databricks.getNotebook({
    path: "/Production/Features",
    format: "SOURCE",
});
Copy
import pulumi
import pulumi_databricks as databricks

features = databricks.get_notebook(path="/Production/Features",
    format="SOURCE")
Copy
package main

import (
	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databricks.LookupNotebook(ctx, &databricks.LookupNotebookArgs{
			Path:   "/Production/Features",
			Format: "SOURCE",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var features = Databricks.GetNotebook.Invoke(new()
    {
        Path = "/Production/Features",
        Format = "SOURCE",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetNotebookArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var features = DatabricksFunctions.getNotebook(GetNotebookArgs.builder()
            .path("/Production/Features")
            .format("SOURCE")
            .build());

    }
}
Copy
variables:
  features:
    fn::invoke:
      function: databricks:getNotebook
      arguments:
        path: /Production/Features
        format: SOURCE
Copy

Using getNotebook

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getNotebook(args: GetNotebookArgs, opts?: InvokeOptions): Promise<GetNotebookResult>
function getNotebookOutput(args: GetNotebookOutputArgs, opts?: InvokeOptions): Output<GetNotebookResult>
Copy
def get_notebook(format: Optional[str] = None,
                 language: Optional[str] = None,
                 object_id: Optional[int] = None,
                 object_type: Optional[str] = None,
                 path: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetNotebookResult
def get_notebook_output(format: Optional[pulumi.Input[str]] = None,
                 language: Optional[pulumi.Input[str]] = None,
                 object_id: Optional[pulumi.Input[int]] = None,
                 object_type: Optional[pulumi.Input[str]] = None,
                 path: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetNotebookResult]
Copy
func LookupNotebook(ctx *Context, args *LookupNotebookArgs, opts ...InvokeOption) (*LookupNotebookResult, error)
func LookupNotebookOutput(ctx *Context, args *LookupNotebookOutputArgs, opts ...InvokeOption) LookupNotebookResultOutput
Copy

> Note: This function is named LookupNotebook in the Go SDK.

public static class GetNotebook 
{
    public static Task<GetNotebookResult> InvokeAsync(GetNotebookArgs args, InvokeOptions? opts = null)
    public static Output<GetNotebookResult> Invoke(GetNotebookInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNotebookResult> getNotebook(GetNotebookArgs args, InvokeOptions options)
public static Output<GetNotebookResult> getNotebook(GetNotebookArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: databricks:index/getNotebook:getNotebook
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Format
This property is required.
Changes to this property will trigger replacement.
string
Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
Path
This property is required.
Changes to this property will trigger replacement.
string
Notebook path on the workspace
Language string
notebook language
ObjectId int
notebook object ID
ObjectType string
notebook object type
Format
This property is required.
Changes to this property will trigger replacement.
string
Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
Path
This property is required.
Changes to this property will trigger replacement.
string
Notebook path on the workspace
Language string
notebook language
ObjectId int
notebook object ID
ObjectType string
notebook object type
format
This property is required.
Changes to this property will trigger replacement.
String
Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
path
This property is required.
Changes to this property will trigger replacement.
String
Notebook path on the workspace
language String
notebook language
objectId Integer
notebook object ID
objectType String
notebook object type
format
This property is required.
Changes to this property will trigger replacement.
string
Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
path
This property is required.
Changes to this property will trigger replacement.
string
Notebook path on the workspace
language string
notebook language
objectId number
notebook object ID
objectType string
notebook object type
format
This property is required.
Changes to this property will trigger replacement.
str
Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
path
This property is required.
Changes to this property will trigger replacement.
str
Notebook path on the workspace
language str
notebook language
object_id int
notebook object ID
object_type str
notebook object type
format
This property is required.
Changes to this property will trigger replacement.
String
Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
path
This property is required.
Changes to this property will trigger replacement.
String
Notebook path on the workspace
language String
notebook language
objectId Number
notebook object ID
objectType String
notebook object type

getNotebook Result

The following output properties are available:

Content string
notebook content in selected format
Format string
Id string
The provider-assigned unique ID for this managed resource.
Language string
notebook language
ObjectId int
notebook object ID
ObjectType string
notebook object type
Path string
WorkspacePath string
path on Workspace File System (WSFS) in form of /Workspace + path
Content string
notebook content in selected format
Format string
Id string
The provider-assigned unique ID for this managed resource.
Language string
notebook language
ObjectId int
notebook object ID
ObjectType string
notebook object type
Path string
WorkspacePath string
path on Workspace File System (WSFS) in form of /Workspace + path
content String
notebook content in selected format
format String
id String
The provider-assigned unique ID for this managed resource.
language String
notebook language
objectId Integer
notebook object ID
objectType String
notebook object type
path String
workspacePath String
path on Workspace File System (WSFS) in form of /Workspace + path
content string
notebook content in selected format
format string
id string
The provider-assigned unique ID for this managed resource.
language string
notebook language
objectId number
notebook object ID
objectType string
notebook object type
path string
workspacePath string
path on Workspace File System (WSFS) in form of /Workspace + path
content str
notebook content in selected format
format str
id str
The provider-assigned unique ID for this managed resource.
language str
notebook language
object_id int
notebook object ID
object_type str
notebook object type
path str
workspace_path str
path on Workspace File System (WSFS) in form of /Workspace + path
content String
notebook content in selected format
format String
id String
The provider-assigned unique ID for this managed resource.
language String
notebook language
objectId Number
notebook object ID
objectType String
notebook object type
path String
workspacePath String
path on Workspace File System (WSFS) in form of /Workspace + path

Package Details

Repository
databricks pulumi/pulumi-databricks
License
Apache-2.0
Notes
This Pulumi package is based on the databricks Terraform Provider.
Databricks v1.65.0 published on Wednesday, Apr 9, 2025 by Pulumi