1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. bigquery
  5. getTables
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.bigquery.getTables

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    Get a list of tables in a BigQuery dataset. For more information see the official documentation and API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const tables = gcp.bigquery.getTables({
        datasetId: "my-bq-dataset",
        project: "my-project",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    tables = gcp.bigquery.get_tables(dataset_id="my-bq-dataset",
        project="my-project")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bigquery.GetTables(ctx, &bigquery.GetTablesArgs{
    			DatasetId: "my-bq-dataset",
    			Project:   pulumi.StringRef("my-project"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var tables = Gcp.BigQuery.GetTables.Invoke(new()
        {
            DatasetId = "my-bq-dataset",
            Project = "my-project",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.bigquery.BigqueryFunctions;
    import com.pulumi.gcp.bigquery.inputs.GetTablesArgs;
    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 tables = BigqueryFunctions.getTables(GetTablesArgs.builder()
                .datasetId("my-bq-dataset")
                .project("my-project")
                .build());
    
        }
    }
    
    variables:
      tables:
        fn::invoke:
          Function: gcp:bigquery:getTables
          Arguments:
            datasetId: my-bq-dataset
            project: my-project
    

    Using getTables

    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 getTables(args: GetTablesArgs, opts?: InvokeOptions): Promise<GetTablesResult>
    function getTablesOutput(args: GetTablesOutputArgs, opts?: InvokeOptions): Output<GetTablesResult>
    def get_tables(dataset_id: Optional[str] = None,
                   project: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetTablesResult
    def get_tables_output(dataset_id: Optional[pulumi.Input[str]] = None,
                   project: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetTablesResult]
    func GetTables(ctx *Context, args *GetTablesArgs, opts ...InvokeOption) (*GetTablesResult, error)
    func GetTablesOutput(ctx *Context, args *GetTablesOutputArgs, opts ...InvokeOption) GetTablesResultOutput

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

    public static class GetTables 
    {
        public static Task<GetTablesResult> InvokeAsync(GetTablesArgs args, InvokeOptions? opts = null)
        public static Output<GetTablesResult> Invoke(GetTablesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTablesResult> getTables(GetTablesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:bigquery/getTables:getTables
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatasetId string
    The dataset ID.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    DatasetId string
    The dataset ID.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    datasetId String
    The dataset ID.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    datasetId string
    The dataset ID.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    dataset_id str
    The dataset ID.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    datasetId String
    The dataset ID.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    getTables Result

    The following output properties are available:

    DatasetId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Tables List<GetTablesTable>
    A list of all retrieved BigQuery tables. Structure is defined below.
    Project string
    DatasetId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Tables []GetTablesTable
    A list of all retrieved BigQuery tables. Structure is defined below.
    Project string
    datasetId String
    id String
    The provider-assigned unique ID for this managed resource.
    tables List<GetTablesTable>
    A list of all retrieved BigQuery tables. Structure is defined below.
    project String
    datasetId string
    id string
    The provider-assigned unique ID for this managed resource.
    tables GetTablesTable[]
    A list of all retrieved BigQuery tables. Structure is defined below.
    project string
    dataset_id str
    id str
    The provider-assigned unique ID for this managed resource.
    tables Sequence[GetTablesTable]
    A list of all retrieved BigQuery tables. Structure is defined below.
    project str
    datasetId String
    id String
    The provider-assigned unique ID for this managed resource.
    tables List<Property Map>
    A list of all retrieved BigQuery tables. Structure is defined below.
    project String

    Supporting Types

    GetTablesTable

    Labels Dictionary<string, string>
    User-provided table labels, in key/value pairs.
    TableId string
    The name of the table.
    Labels map[string]string
    User-provided table labels, in key/value pairs.
    TableId string
    The name of the table.
    labels Map<String,String>
    User-provided table labels, in key/value pairs.
    tableId String
    The name of the table.
    labels {[key: string]: string}
    User-provided table labels, in key/value pairs.
    tableId string
    The name of the table.
    labels Mapping[str, str]
    User-provided table labels, in key/value pairs.
    table_id str
    The name of the table.
    labels Map<String>
    User-provided table labels, in key/value pairs.
    tableId String
    The name of the table.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi