1. Packages
  2. Databricks
  3. API Docs
  4. getNotebook
Databricks v1.36.0 published on Friday, Apr 19, 2024 by Pulumi

databricks.getNotebook

Explore with Pulumi AI

databricks logo
Databricks v1.36.0 published on Friday, Apr 19, 2024 by Pulumi

    Note If you have a fully automated setup with workspaces created by databricks_mws_workspaces, 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, or DBC.
    Path string
    Notebook path on the workspace
    Language string
    notebook language
    ObjectId int
    notebook object ID
    ObjectType string
    notebook object type
    Format string
    Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
    Path string
    Notebook path on the workspace
    Language string
    notebook language
    ObjectId int
    notebook object ID
    ObjectType string
    notebook object type
    format String
    Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
    path String
    Notebook path on the workspace
    language String
    notebook language
    objectId Integer
    notebook object ID
    objectType String
    notebook object type
    format string
    Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
    path string
    Notebook path on the workspace
    language string
    notebook language
    objectId number
    notebook object ID
    objectType string
    notebook object type
    format str
    Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC.
    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, or DBC.
    path 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
    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
    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
    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
    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
    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

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.36.0 published on Friday, Apr 19, 2024 by Pulumi