1. Packages
  2. Databricks
  3. API Docs
  4. getCatalog
Databricks v1.44.0 published on Friday, May 31, 2024 by Pulumi

databricks.getCatalog

Explore with Pulumi AI

databricks logo
Databricks v1.44.0 published on Friday, May 31, 2024 by Pulumi

    Example Usage

    Read on a specific catalog test:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const test = databricks.getCatalog({
        name: "test",
    });
    const things = new databricks.Grants("things", {
        catalog: test.then(test => test.name),
        grants: [{
            principal: "sensitive",
            privileges: ["USE_CATALOG"],
        }],
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    test = databricks.get_catalog(name="test")
    things = databricks.Grants("things",
        catalog=test.name,
        grants=[databricks.GrantsGrantArgs(
            principal="sensitive",
            privileges=["USE_CATALOG"],
        )])
    
    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 {
    		test, err := databricks.LookupCatalog(ctx, &databricks.LookupCatalogArgs{
    			Name: "test",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewGrants(ctx, "things", &databricks.GrantsArgs{
    			Catalog: pulumi.String(test.Name),
    			Grants: databricks.GrantsGrantArray{
    				&databricks.GrantsGrantArgs{
    					Principal: pulumi.String("sensitive"),
    					Privileges: pulumi.StringArray{
    						pulumi.String("USE_CATALOG"),
    					},
    				},
    			},
    		})
    		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 test = Databricks.GetCatalog.Invoke(new()
        {
            Name = "test",
        });
    
        var things = new Databricks.Grants("things", new()
        {
            Catalog = test.Apply(getCatalogResult => getCatalogResult.Name),
            GrantDetails = new[]
            {
                new Databricks.Inputs.GrantsGrantArgs
                {
                    Principal = "sensitive",
                    Privileges = new[]
                    {
                        "USE_CATALOG",
                    },
                },
            },
        });
    
    });
    
    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.GetCatalogArgs;
    import com.pulumi.databricks.Grants;
    import com.pulumi.databricks.GrantsArgs;
    import com.pulumi.databricks.inputs.GrantsGrantArgs;
    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 test = DatabricksFunctions.getCatalog(GetCatalogArgs.builder()
                .name("test")
                .build());
    
            var things = new Grants("things", GrantsArgs.builder()
                .catalog(test.applyValue(getCatalogResult -> getCatalogResult.name()))
                .grants(GrantsGrantArgs.builder()
                    .principal("sensitive")
                    .privileges("USE_CATALOG")
                    .build())
                .build());
    
        }
    }
    
    resources:
      things:
        type: databricks:Grants
        properties:
          catalog: ${test.name}
          grants:
            - principal: sensitive
              privileges:
                - USE_CATALOG
    variables:
      test:
        fn::invoke:
          Function: databricks:getCatalog
          Arguments:
            name: test
    

    The following resources are used in the same context:

    • databricks.Grant to manage grants within Unity Catalog.
    • databricks.getCatalogs to list all catalogs within Unity Catalog metastore.

    Using getCatalog

    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 getCatalog(args: GetCatalogArgs, opts?: InvokeOptions): Promise<GetCatalogResult>
    function getCatalogOutput(args: GetCatalogOutputArgs, opts?: InvokeOptions): Output<GetCatalogResult>
    def get_catalog(catalog_info: Optional[GetCatalogCatalogInfo] = None,
                    id: Optional[str] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetCatalogResult
    def get_catalog_output(catalog_info: Optional[pulumi.Input[GetCatalogCatalogInfoArgs]] = None,
                    id: Optional[pulumi.Input[str]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetCatalogResult]
    func LookupCatalog(ctx *Context, args *LookupCatalogArgs, opts ...InvokeOption) (*LookupCatalogResult, error)
    func LookupCatalogOutput(ctx *Context, args *LookupCatalogOutputArgs, opts ...InvokeOption) LookupCatalogResultOutput

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

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

    The following arguments are supported:

    Name string
    name of the catalog
    CatalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    Id string
    same as the name
    Name string
    name of the catalog
    CatalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    Id string
    same as the name
    name String
    name of the catalog
    catalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id String
    same as the name
    name string
    name of the catalog
    catalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id string
    same as the name
    name str
    name of the catalog
    catalog_info GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id str
    same as the name
    name String
    name of the catalog
    catalogInfo Property Map
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id String
    same as the name

    getCatalog Result

    The following output properties are available:

    CatalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    Id string
    same as the name
    Name string
    Name of the catalog
    CatalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    Id string
    same as the name
    Name string
    Name of the catalog
    catalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id String
    same as the name
    name String
    Name of the catalog
    catalogInfo GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id string
    same as the name
    name string
    Name of the catalog
    catalog_info GetCatalogCatalogInfo
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id str
    same as the name
    name str
    Name of the catalog
    catalogInfo Property Map
    the CatalogInfo object for a Unity Catalog catalog. This contains the following attributes (see ):
    id String
    same as the name
    name String
    Name of the catalog

    Supporting Types

    GetCatalogCatalogInfo

    BrowseOnly bool
    CatalogType string
    Type of the catalog, e.g. MANAGED_CATALOG, DELTASHARING_CATALOG, SYSTEM_CATALOG,
    Comment string
    Free-form text description
    ConnectionName string
    The name of the connection to an external data source.
    CreatedAt int
    Time at which this catalog was created, in epoch milliseconds.
    CreatedBy string
    Username of catalog creator.
    EffectivePredictiveOptimizationFlag GetCatalogCatalogInfoEffectivePredictiveOptimizationFlag
    object describing applied predictive optimization flag.
    EnablePredictiveOptimization string
    Whether predictive optimization should be enabled for this object and objects under it.
    FullName string
    The full name of the catalog. Corresponds with the name field.
    IsolationMode string
    Whether the current securable is accessible from all workspaces or a specific set of workspaces.
    MetastoreId string
    Unique identifier of parent metastore.
    Name string
    name of the catalog
    Options Dictionary<string, object>
    A map of key-value properties attached to the securable.
    Owner string
    Current owner of the catalog
    Properties Dictionary<string, object>
    A map of key-value properties attached to the securable.
    ProviderName string
    The name of delta sharing provider.
    ProvisioningInfo GetCatalogCatalogInfoProvisioningInfo
    SecurableKind string
    Kind of catalog securable.
    SecurableType string
    Securable type.
    ShareName string
    The name of the share under the share provider.
    StorageLocation string
    Storage Location URL (full path) for managed tables within catalog.
    StorageRoot string
    Storage root URL for managed tables within catalog.
    UpdatedAt int
    Time at which this catalog was last modified, in epoch milliseconds.
    UpdatedBy string
    Username of user who last modified catalog.
    BrowseOnly bool
    CatalogType string
    Type of the catalog, e.g. MANAGED_CATALOG, DELTASHARING_CATALOG, SYSTEM_CATALOG,
    Comment string
    Free-form text description
    ConnectionName string
    The name of the connection to an external data source.
    CreatedAt int
    Time at which this catalog was created, in epoch milliseconds.
    CreatedBy string
    Username of catalog creator.
    EffectivePredictiveOptimizationFlag GetCatalogCatalogInfoEffectivePredictiveOptimizationFlag
    object describing applied predictive optimization flag.
    EnablePredictiveOptimization string
    Whether predictive optimization should be enabled for this object and objects under it.
    FullName string
    The full name of the catalog. Corresponds with the name field.
    IsolationMode string
    Whether the current securable is accessible from all workspaces or a specific set of workspaces.
    MetastoreId string
    Unique identifier of parent metastore.
    Name string
    name of the catalog
    Options map[string]interface{}
    A map of key-value properties attached to the securable.
    Owner string
    Current owner of the catalog
    Properties map[string]interface{}
    A map of key-value properties attached to the securable.
    ProviderName string
    The name of delta sharing provider.
    ProvisioningInfo GetCatalogCatalogInfoProvisioningInfo
    SecurableKind string
    Kind of catalog securable.
    SecurableType string
    Securable type.
    ShareName string
    The name of the share under the share provider.
    StorageLocation string
    Storage Location URL (full path) for managed tables within catalog.
    StorageRoot string
    Storage root URL for managed tables within catalog.
    UpdatedAt int
    Time at which this catalog was last modified, in epoch milliseconds.
    UpdatedBy string
    Username of user who last modified catalog.
    browseOnly Boolean
    catalogType String
    Type of the catalog, e.g. MANAGED_CATALOG, DELTASHARING_CATALOG, SYSTEM_CATALOG,
    comment String
    Free-form text description
    connectionName String
    The name of the connection to an external data source.
    createdAt Integer
    Time at which this catalog was created, in epoch milliseconds.
    createdBy String
    Username of catalog creator.
    effectivePredictiveOptimizationFlag GetCatalogCatalogInfoEffectivePredictiveOptimizationFlag
    object describing applied predictive optimization flag.
    enablePredictiveOptimization String
    Whether predictive optimization should be enabled for this object and objects under it.
    fullName String
    The full name of the catalog. Corresponds with the name field.
    isolationMode String
    Whether the current securable is accessible from all workspaces or a specific set of workspaces.
    metastoreId String
    Unique identifier of parent metastore.
    name String
    name of the catalog
    options Map<String,Object>
    A map of key-value properties attached to the securable.
    owner String
    Current owner of the catalog
    properties Map<String,Object>
    A map of key-value properties attached to the securable.
    providerName String
    The name of delta sharing provider.
    provisioningInfo GetCatalogCatalogInfoProvisioningInfo
    securableKind String
    Kind of catalog securable.
    securableType String
    Securable type.
    shareName String
    The name of the share under the share provider.
    storageLocation String
    Storage Location URL (full path) for managed tables within catalog.
    storageRoot String
    Storage root URL for managed tables within catalog.
    updatedAt Integer
    Time at which this catalog was last modified, in epoch milliseconds.
    updatedBy String
    Username of user who last modified catalog.
    browseOnly boolean
    catalogType string
    Type of the catalog, e.g. MANAGED_CATALOG, DELTASHARING_CATALOG, SYSTEM_CATALOG,
    comment string
    Free-form text description
    connectionName string
    The name of the connection to an external data source.
    createdAt number
    Time at which this catalog was created, in epoch milliseconds.
    createdBy string
    Username of catalog creator.
    effectivePredictiveOptimizationFlag GetCatalogCatalogInfoEffectivePredictiveOptimizationFlag
    object describing applied predictive optimization flag.
    enablePredictiveOptimization string
    Whether predictive optimization should be enabled for this object and objects under it.
    fullName string
    The full name of the catalog. Corresponds with the name field.
    isolationMode string
    Whether the current securable is accessible from all workspaces or a specific set of workspaces.
    metastoreId string
    Unique identifier of parent metastore.
    name string
    name of the catalog
    options {[key: string]: any}
    A map of key-value properties attached to the securable.
    owner string
    Current owner of the catalog
    properties {[key: string]: any}
    A map of key-value properties attached to the securable.
    providerName string
    The name of delta sharing provider.
    provisioningInfo GetCatalogCatalogInfoProvisioningInfo
    securableKind string
    Kind of catalog securable.
    securableType string
    Securable type.
    shareName string
    The name of the share under the share provider.
    storageLocation string
    Storage Location URL (full path) for managed tables within catalog.
    storageRoot string
    Storage root URL for managed tables within catalog.
    updatedAt number
    Time at which this catalog was last modified, in epoch milliseconds.
    updatedBy string
    Username of user who last modified catalog.
    browse_only bool
    catalog_type str
    Type of the catalog, e.g. MANAGED_CATALOG, DELTASHARING_CATALOG, SYSTEM_CATALOG,
    comment str
    Free-form text description
    connection_name str
    The name of the connection to an external data source.
    created_at int
    Time at which this catalog was created, in epoch milliseconds.
    created_by str
    Username of catalog creator.
    effective_predictive_optimization_flag GetCatalogCatalogInfoEffectivePredictiveOptimizationFlag
    object describing applied predictive optimization flag.
    enable_predictive_optimization str
    Whether predictive optimization should be enabled for this object and objects under it.
    full_name str
    The full name of the catalog. Corresponds with the name field.
    isolation_mode str
    Whether the current securable is accessible from all workspaces or a specific set of workspaces.
    metastore_id str
    Unique identifier of parent metastore.
    name str
    name of the catalog
    options Mapping[str, Any]
    A map of key-value properties attached to the securable.
    owner str
    Current owner of the catalog
    properties Mapping[str, Any]
    A map of key-value properties attached to the securable.
    provider_name str
    The name of delta sharing provider.
    provisioning_info GetCatalogCatalogInfoProvisioningInfo
    securable_kind str
    Kind of catalog securable.
    securable_type str
    Securable type.
    share_name str
    The name of the share under the share provider.
    storage_location str
    Storage Location URL (full path) for managed tables within catalog.
    storage_root str
    Storage root URL for managed tables within catalog.
    updated_at int
    Time at which this catalog was last modified, in epoch milliseconds.
    updated_by str
    Username of user who last modified catalog.
    browseOnly Boolean
    catalogType String
    Type of the catalog, e.g. MANAGED_CATALOG, DELTASHARING_CATALOG, SYSTEM_CATALOG,
    comment String
    Free-form text description
    connectionName String
    The name of the connection to an external data source.
    createdAt Number
    Time at which this catalog was created, in epoch milliseconds.
    createdBy String
    Username of catalog creator.
    effectivePredictiveOptimizationFlag Property Map
    object describing applied predictive optimization flag.
    enablePredictiveOptimization String
    Whether predictive optimization should be enabled for this object and objects under it.
    fullName String
    The full name of the catalog. Corresponds with the name field.
    isolationMode String
    Whether the current securable is accessible from all workspaces or a specific set of workspaces.
    metastoreId String
    Unique identifier of parent metastore.
    name String
    name of the catalog
    options Map<Any>
    A map of key-value properties attached to the securable.
    owner String
    Current owner of the catalog
    properties Map<Any>
    A map of key-value properties attached to the securable.
    providerName String
    The name of delta sharing provider.
    provisioningInfo Property Map
    securableKind String
    Kind of catalog securable.
    securableType String
    Securable type.
    shareName String
    The name of the share under the share provider.
    storageLocation String
    Storage Location URL (full path) for managed tables within catalog.
    storageRoot String
    Storage root URL for managed tables within catalog.
    updatedAt Number
    Time at which this catalog was last modified, in epoch milliseconds.
    updatedBy String
    Username of user who last modified catalog.

    GetCatalogCatalogInfoEffectivePredictiveOptimizationFlag

    GetCatalogCatalogInfoProvisioningInfo

    State string
    State string
    state String
    state string
    state str
    state 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.44.0 published on Friday, May 31, 2024 by Pulumi