1. Packages
  2. Dynatrace
  3. API Docs
  4. getDocuments
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

dynatrace.getDocuments

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse
    • type (String) The type of documents to query for. Leave empty if you want to query for all kinds of documents.

    Prerequisites

    Using this resource requires an OAuth client to be configured within your account settings. The scopes of the OAuth Client need to contain the permission to read documents (document:documents:read).

    Finally the provider configuration requires the credentials for that OAuth Client. The configuration section of your provider needs to look like this.

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    In order to handle credentials in a secure manner we recommend to use the environment variables DYNATRACE_AUTOMATION_CLIENT_ID and DYNATRACE_AUTOMATION_CLIENT_SECRET as an alternative.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumi/dynatrace";
    
    const all-dashboard-and-notebooks = dynatrace.getDocuments({});
    const all-dashboards = dynatrace.getDocuments({
        type: "dashboard",
    });
    const all-notebooks = dynatrace.getDocuments({
        type: "notebook",
    });
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    
    all_dashboard_and_notebooks = dynatrace.get_documents()
    all_dashboards = dynatrace.get_documents(type="dashboard")
    all_notebooks = dynatrace.get_documents(type="notebook")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dynatrace.GetDocuments(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.GetDocuments(ctx, &dynatrace.GetDocumentsArgs{
    			Type: pulumi.StringRef("dashboard"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.GetDocuments(ctx, &dynatrace.GetDocumentsArgs{
    			Type: pulumi.StringRef("notebook"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Dynatrace = Pulumi.Dynatrace;
    
    return await Deployment.RunAsync(() => 
    {
        var all_dashboard_and_notebooks = Dynatrace.GetDocuments.Invoke();
    
        var all_dashboards = Dynatrace.GetDocuments.Invoke(new()
        {
            Type = "dashboard",
        });
    
        var all_notebooks = Dynatrace.GetDocuments.Invoke(new()
        {
            Type = "notebook",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.DynatraceFunctions;
    import com.pulumi.dynatrace.inputs.GetDocumentsArgs;
    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-dashboard-and-notebooks = DynatraceFunctions.getDocuments();
    
            final var all-dashboards = DynatraceFunctions.getDocuments(GetDocumentsArgs.builder()
                .type("dashboard")
                .build());
    
            final var all-notebooks = DynatraceFunctions.getDocuments(GetDocumentsArgs.builder()
                .type("notebook")
                .build());
    
        }
    }
    
    variables:
      all-dashboard-and-notebooks:
        fn::invoke:
          Function: dynatrace:getDocuments
          Arguments: {}
      all-dashboards:
        fn::invoke:
          Function: dynatrace:getDocuments
          Arguments:
            type: dashboard
      all-notebooks:
        fn::invoke:
          Function: dynatrace:getDocuments
          Arguments:
            type: notebook
    

    Using getDocuments

    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 getDocuments(args: GetDocumentsArgs, opts?: InvokeOptions): Promise<GetDocumentsResult>
    function getDocumentsOutput(args: GetDocumentsOutputArgs, opts?: InvokeOptions): Output<GetDocumentsResult>
    def get_documents(type: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDocumentsResult
    def get_documents_output(type: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDocumentsResult]
    func GetDocuments(ctx *Context, args *GetDocumentsArgs, opts ...InvokeOption) (*GetDocumentsResult, error)
    func GetDocumentsOutput(ctx *Context, args *GetDocumentsOutputArgs, opts ...InvokeOption) GetDocumentsResultOutput

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

    public static class GetDocuments 
    {
        public static Task<GetDocumentsResult> InvokeAsync(GetDocumentsArgs args, InvokeOptions? opts = null)
        public static Output<GetDocumentsResult> Invoke(GetDocumentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDocumentsResult> getDocuments(GetDocumentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: dynatrace:index/getDocuments:getDocuments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Type string
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    Type string
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    type String
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    type string
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    type str
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    type String
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook

    getDocuments Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Values List<Pulumiverse.Dynatrace.Outputs.GetDocumentsValue>
    Type string
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    Id string
    The provider-assigned unique ID for this managed resource.
    Values []GetDocumentsValue
    Type string
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    id String
    The provider-assigned unique ID for this managed resource.
    values List<GetDocumentsValue>
    type String
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    id string
    The provider-assigned unique ID for this managed resource.
    values GetDocumentsValue[]
    type string
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    id str
    The provider-assigned unique ID for this managed resource.
    values Sequence[GetDocumentsValue]
    type str
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook
    id String
    The provider-assigned unique ID for this managed resource.
    values List<Property Map>
    type String
    The type of documents to query for. Leave empty if you want to query for all kinds of documents. Possible values are dashboard or notebook

    Supporting Types

    GetDocumentsValue

    Id string
    The unique identifier of the document.
    Name string
    The name of the document.
    Owner string
    The owner of the document. This could be a user or a group that has ownership rights over the document.
    Type string
    The type of the document. This could be a specific format or category the document belongs to.
    Id string
    The unique identifier of the document.
    Name string
    The name of the document.
    Owner string
    The owner of the document. This could be a user or a group that has ownership rights over the document.
    Type string
    The type of the document. This could be a specific format or category the document belongs to.
    id String
    The unique identifier of the document.
    name String
    The name of the document.
    owner String
    The owner of the document. This could be a user or a group that has ownership rights over the document.
    type String
    The type of the document. This could be a specific format or category the document belongs to.
    id string
    The unique identifier of the document.
    name string
    The name of the document.
    owner string
    The owner of the document. This could be a user or a group that has ownership rights over the document.
    type string
    The type of the document. This could be a specific format or category the document belongs to.
    id str
    The unique identifier of the document.
    name str
    The name of the document.
    owner str
    The owner of the document. This could be a user or a group that has ownership rights over the document.
    type str
    The type of the document. This could be a specific format or category the document belongs to.
    id String
    The unique identifier of the document.
    name String
    The name of the document.
    owner String
    The owner of the document. This could be a user or a group that has ownership rights over the document.
    type String
    The type of the document. This could be a specific format or category the document belongs to.

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse