1. Packages
  2. Grafana Cloud
  3. API Docs
  4. getFolders
Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse

grafana.getFolders

Explore with Pulumi AI

grafana logo
Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumi/grafana";
    import * as grafana from "@pulumiverse/grafana";
    
    const testA = new grafana.Folder("testA", {
        title: "test-folder-a",
        uid: "test-ds-folder-uid-a",
    });
    const testB = new grafana.Folder("testB", {
        title: "test-folder-b",
        uid: "test-ds-folder-uid-b",
    });
    const test = grafana.getFolders({});
    
    import pulumi
    import pulumi_grafana as grafana
    import pulumiverse_grafana as grafana
    
    test_a = grafana.Folder("testA",
        title="test-folder-a",
        uid="test-ds-folder-uid-a")
    test_b = grafana.Folder("testB",
        title="test-folder-b",
        uid="test-ds-folder-uid-b")
    test = grafana.get_folders()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := grafana.NewFolder(ctx, "testA", &grafana.FolderArgs{
    			Title: pulumi.String("test-folder-a"),
    			Uid:   pulumi.String("test-ds-folder-uid-a"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = grafana.NewFolder(ctx, "testB", &grafana.FolderArgs{
    			Title: pulumi.String("test-folder-b"),
    			Uid:   pulumi.String("test-ds-folder-uid-b"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = grafana.GetFolders(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumi.Grafana;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var testA = new Grafana.Folder("testA", new()
        {
            Title = "test-folder-a",
            Uid = "test-ds-folder-uid-a",
        });
    
        var testB = new Grafana.Folder("testB", new()
        {
            Title = "test-folder-b",
            Uid = "test-ds-folder-uid-b",
        });
    
        var test = Grafana.GetFolders.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.Folder;
    import com.pulumi.grafana.FolderArgs;
    import com.pulumi.grafana.GrafanaFunctions;
    import com.pulumi.grafana.inputs.GetFoldersArgs;
    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) {
            var testA = new Folder("testA", FolderArgs.builder()        
                .title("test-folder-a")
                .uid("test-ds-folder-uid-a")
                .build());
    
            var testB = new Folder("testB", FolderArgs.builder()        
                .title("test-folder-b")
                .uid("test-ds-folder-uid-b")
                .build());
    
            final var test = GrafanaFunctions.getFolders();
    
        }
    }
    
    resources:
      testA:
        type: grafana:Folder
        properties:
          title: test-folder-a
          uid: test-ds-folder-uid-a
      testB:
        type: grafana:Folder
        properties:
          title: test-folder-b
          uid: test-ds-folder-uid-b
    variables:
      test:
        fn::invoke:
          Function: grafana:getFolders
          Arguments: {}
    

    Using getFolders

    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 getFolders(args: GetFoldersArgs, opts?: InvokeOptions): Promise<GetFoldersResult>
    function getFoldersOutput(args: GetFoldersOutputArgs, opts?: InvokeOptions): Output<GetFoldersResult>
    def get_folders(org_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetFoldersResult
    def get_folders_output(org_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetFoldersResult]
    func GetFolders(ctx *Context, args *GetFoldersArgs, opts ...InvokeOption) (*GetFoldersResult, error)
    func GetFoldersOutput(ctx *Context, args *GetFoldersOutputArgs, opts ...InvokeOption) GetFoldersResultOutput

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

    public static class GetFolders 
    {
        public static Task<GetFoldersResult> InvokeAsync(GetFoldersArgs args, InvokeOptions? opts = null)
        public static Output<GetFoldersResult> Invoke(GetFoldersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFoldersResult> getFolders(GetFoldersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: grafana:index/getFolders:getFolders
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    orgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    org_id str
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    getFolders Result

    The following output properties are available:

    Folders List<Pulumiverse.Grafana.Outputs.GetFoldersFolder>
    The Grafana instance's folders.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    Folders []GetFoldersFolder
    The Grafana instance's folders.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    folders List<GetFoldersFolder>
    The Grafana instance's folders.
    id String
    The provider-assigned unique ID for this managed resource.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    folders GetFoldersFolder[]
    The Grafana instance's folders.
    id string
    The provider-assigned unique ID for this managed resource.
    orgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    folders Sequence[GetFoldersFolder]
    The Grafana instance's folders.
    id str
    The provider-assigned unique ID for this managed resource.
    org_id str
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    folders List<Property Map>
    The Grafana instance's folders.
    id String
    The provider-assigned unique ID for this managed resource.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    Supporting Types

    GetFoldersFolder

    Id int
    The folder ID.
    Title string
    The folder title.
    Uid string
    The folder's unique identifier.
    Url string
    The folder's URL
    Id int
    The folder ID.
    Title string
    The folder title.
    Uid string
    The folder's unique identifier.
    Url string
    The folder's URL
    id Integer
    The folder ID.
    title String
    The folder title.
    uid String
    The folder's unique identifier.
    url String
    The folder's URL
    id number
    The folder ID.
    title string
    The folder title.
    uid string
    The folder's unique identifier.
    url string
    The folder's URL
    id int
    The folder ID.
    title str
    The folder title.
    uid str
    The folder's unique identifier.
    url str
    The folder's URL
    id Number
    The folder ID.
    title String
    The folder title.
    uid String
    The folder's unique identifier.
    url String
    The folder's URL

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo
    Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse