1. Packages
  2. Databricks
  3. API Docs
  4. getSchemas
Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi

databricks.getSchemas

Explore with Pulumi AI

databricks logo
Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi

    Note This data source can only be used with a workspace-level provider!

    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.

    Retrieves a list of databricks.Schema ids, that were created by Pulumi or manually, so that special handling could be applied.

    Example Usage

    Listing all schemas in a sandbox databricks_catalog:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const sandbox = databricks.getSchemas({
        catalogName: "sandbox",
    });
    export const allSandboxSchemas = sandbox;
    
    import pulumi
    import pulumi_databricks as databricks
    
    sandbox = databricks.get_schemas(catalog_name="sandbox")
    pulumi.export("allSandboxSchemas", sandbox)
    
    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 {
    		sandbox, err := databricks.GetSchemas(ctx, &databricks.GetSchemasArgs{
    			CatalogName: "sandbox",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("allSandboxSchemas", sandbox)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var sandbox = Databricks.GetSchemas.Invoke(new()
        {
            CatalogName = "sandbox",
        });
    
        return new Dictionary<string, object?>
        {
            ["allSandboxSchemas"] = sandbox,
        };
    });
    
    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.GetSchemasArgs;
    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 sandbox = DatabricksFunctions.getSchemas(GetSchemasArgs.builder()
                .catalogName("sandbox")
                .build());
    
            ctx.export("allSandboxSchemas", sandbox.applyValue(getSchemasResult -> getSchemasResult));
        }
    }
    
    variables:
      sandbox:
        fn::invoke:
          Function: databricks:getSchemas
          Arguments:
            catalogName: sandbox
    outputs:
      allSandboxSchemas: ${sandbox}
    

    The following resources are used in the same context:

    • databricks.Schema to manage schemas within Unity Catalog.
    • databricks.Catalog to manage catalogs within Unity Catalog.

    Using getSchemas

    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 getSchemas(args: GetSchemasArgs, opts?: InvokeOptions): Promise<GetSchemasResult>
    function getSchemasOutput(args: GetSchemasOutputArgs, opts?: InvokeOptions): Output<GetSchemasResult>
    def get_schemas(catalog_name: Optional[str] = None,
                    ids: Optional[Sequence[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetSchemasResult
    def get_schemas_output(catalog_name: Optional[pulumi.Input[str]] = None,
                    ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetSchemasResult]
    func GetSchemas(ctx *Context, args *GetSchemasArgs, opts ...InvokeOption) (*GetSchemasResult, error)
    func GetSchemasOutput(ctx *Context, args *GetSchemasOutputArgs, opts ...InvokeOption) GetSchemasResultOutput

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

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

    The following arguments are supported:

    CatalogName string
    Name of databricks_catalog
    Ids List<string>
    set of databricks.Schema full names: catalog.schema
    CatalogName string
    Name of databricks_catalog
    Ids []string
    set of databricks.Schema full names: catalog.schema
    catalogName String
    Name of databricks_catalog
    ids List<String>
    set of databricks.Schema full names: catalog.schema
    catalogName string
    Name of databricks_catalog
    ids string[]
    set of databricks.Schema full names: catalog.schema
    catalog_name str
    Name of databricks_catalog
    ids Sequence[str]
    set of databricks.Schema full names: catalog.schema
    catalogName String
    Name of databricks_catalog
    ids List<String>
    set of databricks.Schema full names: catalog.schema

    getSchemas Result

    The following output properties are available:

    CatalogName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    set of databricks.Schema full names: catalog.schema
    CatalogName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    set of databricks.Schema full names: catalog.schema
    catalogName String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    set of databricks.Schema full names: catalog.schema
    catalogName string
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    set of databricks.Schema full names: catalog.schema
    catalog_name str
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    set of databricks.Schema full names: catalog.schema
    catalogName String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    set of databricks.Schema full names: catalog.schema

    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.56.0 published on Tuesday, Nov 12, 2024 by Pulumi