1. Packages
  2. Databricks
  3. API Docs
  4. getDbfsFile
Databricks v1.46.1 published on Friday, Jun 28, 2024 by Pulumi

databricks.getDbfsFile

Explore with Pulumi AI

databricks logo
Databricks v1.46.1 published on Friday, Jun 28, 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 get file content from Databricks File System (DBFS).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const report = databricks.getDbfsFile({
        path: "dbfs:/reports/some.csv",
        limitFileSize: true,
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    report = databricks.get_dbfs_file(path="dbfs:/reports/some.csv",
        limit_file_size=True)
    
    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.LookupDbfsFile(ctx, &databricks.LookupDbfsFileArgs{
    			Path:          "dbfs:/reports/some.csv",
    			LimitFileSize: true,
    		}, 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 report = Databricks.GetDbfsFile.Invoke(new()
        {
            Path = "dbfs:/reports/some.csv",
            LimitFileSize = true,
        });
    
    });
    
    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.GetDbfsFileArgs;
    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 report = DatabricksFunctions.getDbfsFile(GetDbfsFileArgs.builder()
                .path("dbfs:/reports/some.csv")
                .limitFileSize("true")
                .build());
    
        }
    }
    
    variables:
      report:
        fn::invoke:
          Function: databricks:getDbfsFile
          Arguments:
            path: dbfs:/reports/some.csv
            limitFileSize: 'true'
    

    The following resources are used in the same context:

    Using getDbfsFile

    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 getDbfsFile(args: GetDbfsFileArgs, opts?: InvokeOptions): Promise<GetDbfsFileResult>
    function getDbfsFileOutput(args: GetDbfsFileOutputArgs, opts?: InvokeOptions): Output<GetDbfsFileResult>
    def get_dbfs_file(limit_file_size: Optional[bool] = None,
                      path: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDbfsFileResult
    def get_dbfs_file_output(limit_file_size: Optional[pulumi.Input[bool]] = None,
                      path: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDbfsFileResult]
    func LookupDbfsFile(ctx *Context, args *LookupDbfsFileArgs, opts ...InvokeOption) (*LookupDbfsFileResult, error)
    func LookupDbfsFileOutput(ctx *Context, args *LookupDbfsFileOutputArgs, opts ...InvokeOption) LookupDbfsFileResultOutput

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

    public static class GetDbfsFile 
    {
        public static Task<GetDbfsFileResult> InvokeAsync(GetDbfsFileArgs args, InvokeOptions? opts = null)
        public static Output<GetDbfsFileResult> Invoke(GetDbfsFileInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDbfsFileResult> getDbfsFile(GetDbfsFileArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: databricks:index/getDbfsFile:getDbfsFile
      arguments:
        # arguments dictionary

    The following arguments are supported:

    LimitFileSize bool
    Do not load content for files larger than 4MB.
    Path string
    Path on DBFS for the file from which to get content.
    LimitFileSize bool
    Do not load content for files larger than 4MB.
    Path string
    Path on DBFS for the file from which to get content.
    limitFileSize Boolean
    Do not load content for files larger than 4MB.
    path String
    Path on DBFS for the file from which to get content.
    limitFileSize boolean
    Do not load content for files larger than 4MB.
    path string
    Path on DBFS for the file from which to get content.
    limit_file_size bool
    Do not load content for files larger than 4MB.
    path str
    Path on DBFS for the file from which to get content.
    limitFileSize Boolean
    Do not load content for files larger than 4MB.
    path String
    Path on DBFS for the file from which to get content.

    getDbfsFile Result

    The following output properties are available:

    Content string
    base64-encoded file contents
    FileSize int
    size of the file in bytes
    Id string
    The provider-assigned unique ID for this managed resource.
    LimitFileSize bool
    Path string
    Content string
    base64-encoded file contents
    FileSize int
    size of the file in bytes
    Id string
    The provider-assigned unique ID for this managed resource.
    LimitFileSize bool
    Path string
    content String
    base64-encoded file contents
    fileSize Integer
    size of the file in bytes
    id String
    The provider-assigned unique ID for this managed resource.
    limitFileSize Boolean
    path String
    content string
    base64-encoded file contents
    fileSize number
    size of the file in bytes
    id string
    The provider-assigned unique ID for this managed resource.
    limitFileSize boolean
    path string
    content str
    base64-encoded file contents
    file_size int
    size of the file in bytes
    id str
    The provider-assigned unique ID for this managed resource.
    limit_file_size bool
    path str
    content String
    base64-encoded file contents
    fileSize Number
    size of the file in bytes
    id String
    The provider-assigned unique ID for this managed resource.
    limitFileSize Boolean
    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.46.1 published on Friday, Jun 28, 2024 by Pulumi