1. Packages
  2. Databricks
  3. API Docs
  4. getMetastores
Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi

databricks.getMetastores

Explore with Pulumi AI

databricks logo
Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi

    Example Usage

    Mapping of name to id of all metastores:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const all = databricks.getMetastores({});
    export const allMetastores = all.then(all => all.ids);
    
    import pulumi
    import pulumi_databricks as databricks
    
    all = databricks.get_metastores()
    pulumi.export("allMetastores", all.ids)
    
    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 {
    		all, err := databricks.GetMetastores(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("allMetastores", all.Ids)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Databricks.GetMetastores.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["allMetastores"] = all.Apply(getMetastoresResult => getMetastoresResult.Ids),
        };
    });
    
    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.GetMetastoresArgs;
    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 all = DatabricksFunctions.getMetastores();
    
            ctx.export("allMetastores", all.applyValue(getMetastoresResult -> getMetastoresResult.ids()));
        }
    }
    
    variables:
      all:
        fn::invoke:
          Function: databricks:getMetastores
          Arguments: {}
    outputs:
      allMetastores: ${all.ids}
    

    The following resources are used in the same context:

    • databricks.Metastore to get information about a single metastore.
    • databricks.Metastore to manage Metastores within Unity Catalog.
    • databricks.Catalog to manage catalogs within Unity Catalog.

    Using getMetastores

    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 getMetastores(args: GetMetastoresArgs, opts?: InvokeOptions): Promise<GetMetastoresResult>
    function getMetastoresOutput(args: GetMetastoresOutputArgs, opts?: InvokeOptions): Output<GetMetastoresResult>
    def get_metastores(ids: Optional[Mapping[str, Any]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetMetastoresResult
    def get_metastores_output(ids: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetMetastoresResult]
    func GetMetastores(ctx *Context, args *GetMetastoresArgs, opts ...InvokeOption) (*GetMetastoresResult, error)
    func GetMetastoresOutput(ctx *Context, args *GetMetastoresOutputArgs, opts ...InvokeOption) GetMetastoresResultOutput

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

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

    The following arguments are supported:

    Ids Dictionary<string, object>
    Mapping of name to id of databricks_metastore
    Ids map[string]interface{}
    Mapping of name to id of databricks_metastore
    ids Map<String,Object>
    Mapping of name to id of databricks_metastore
    ids {[key: string]: any}
    Mapping of name to id of databricks_metastore
    ids Mapping[str, Any]
    Mapping of name to id of databricks_metastore
    ids Map<Any>
    Mapping of name to id of databricks_metastore

    getMetastores Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids Dictionary<string, object>
    Mapping of name to id of databricks_metastore
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids map[string]interface{}
    Mapping of name to id of databricks_metastore
    id String
    The provider-assigned unique ID for this managed resource.
    ids Map<String,Object>
    Mapping of name to id of databricks_metastore
    id string
    The provider-assigned unique ID for this managed resource.
    ids {[key: string]: any}
    Mapping of name to id of databricks_metastore
    id str
    The provider-assigned unique ID for this managed resource.
    ids Mapping[str, Any]
    Mapping of name to id of databricks_metastore
    id String
    The provider-assigned unique ID for this managed resource.
    ids Map<Any>
    Mapping of name to id of databricks_metastore

    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.38.0 published on Monday, Apr 29, 2024 by Pulumi