Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi
databricks.getNotebook
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_databricks as databricks
features = databricks.get_notebook(path="/Production/Features",
format="SOURCE")
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
})
}
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",
});
});
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());
}
}
variables:
features:
fn::invoke:
Function: databricks:getNotebook
Arguments:
path: /Production/Features
format: SOURCE
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>
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]
func LookupNotebook(ctx *Context, args *LookupNotebookArgs, opts ...InvokeOption) (*LookupNotebookResult, error)
func LookupNotebookOutput(ctx *Context, args *LookupNotebookOutputArgs, opts ...InvokeOption) LookupNotebookResultOutput
> 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)
}
public static CompletableFuture<GetNotebookResult> getNotebook(GetNotebookArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getNotebook:getNotebook
arguments:
# arguments dictionary
The following arguments are supported:
- Format string
- Notebook format to export. Either
SOURCE
,HTML
,JUPYTER
, orDBC
. - Path string
- Notebook path on the workspace
- Language string
- notebook language
- Object
Id int - notebook object ID
- Object
Type string - notebook object type
- Format string
- Notebook format to export. Either
SOURCE
,HTML
,JUPYTER
, orDBC
. - Path string
- Notebook path on the workspace
- Language string
- notebook language
- Object
Id int - notebook object ID
- Object
Type string - notebook object type
- format String
- Notebook format to export. Either
SOURCE
,HTML
,JUPYTER
, orDBC
. - path String
- Notebook path on the workspace
- language String
- notebook language
- object
Id Integer - notebook object ID
- object
Type String - notebook object type
- format string
- Notebook format to export. Either
SOURCE
,HTML
,JUPYTER
, orDBC
. - path string
- Notebook path on the workspace
- language string
- notebook language
- object
Id number - notebook object ID
- object
Type string - notebook object type
- format str
- Notebook format to export. Either
SOURCE
,HTML
,JUPYTER
, orDBC
. - path str
- Notebook path on the workspace
- language str
- notebook language
- object_
id int - notebook object ID
- object_
type str - notebook object type
- format String
- Notebook format to export. Either
SOURCE
,HTML
,JUPYTER
, orDBC
. - path String
- Notebook path on the workspace
- language String
- notebook language
- object
Id Number - notebook object ID
- object
Type 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
- Object
Id int - notebook object ID
- Object
Type string - notebook object type
- Path string
- Workspace
Path 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
- Object
Id int - notebook object ID
- Object
Type string - notebook object type
- Path string
- Workspace
Path 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
- object
Id Integer - notebook object ID
- object
Type String - notebook object type
- path String
- workspace
Path 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
- object
Id number - notebook object ID
- object
Type string - notebook object type
- path string
- workspace
Path 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
- object
Id Number - notebook object ID
- object
Type String - notebook object type
- path String
- workspace
Path 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.