1. Packages
  2. Grafana Cloud
  3. API Docs
  4. getLibraryPanels
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.getLibraryPanels

Explore with Pulumi AI

Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse
Deprecated: grafana.index/getlibrarypanels.getLibraryPanels has been deprecated in favor of grafana.oss/getlibrarypanels.getLibraryPanels

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";

const test = new grafana.oss.LibraryPanel("test", {
    name: "panelname",
    modelJson: JSON.stringify({
        title: "test name",
        type: "text",
        version: 0,
        description: "test description",
    }),
});
const testFolder = new grafana.oss.Folder("test", {
    title: "Panel Folder",
    uid: "panelname-folder",
});
const folder = new grafana.oss.LibraryPanel("folder", {
    name: "panelname In Folder",
    folderUid: testFolder.uid,
    modelJson: JSON.stringify({
        gridPos: {
            x: 0,
            y: 0,
            h: 10,
            w: 10,
        },
        title: "panel",
        type: "text",
        version: 0,
    }),
});
const all = grafana.oss.getLibraryPanels({});
Copy
import pulumi
import json
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana

test = grafana.oss.LibraryPanel("test",
    name="panelname",
    model_json=json.dumps({
        "title": "test name",
        "type": "text",
        "version": 0,
        "description": "test description",
    }))
test_folder = grafana.oss.Folder("test",
    title="Panel Folder",
    uid="panelname-folder")
folder = grafana.oss.LibraryPanel("folder",
    name="panelname In Folder",
    folder_uid=test_folder.uid,
    model_json=json.dumps({
        "gridPos": {
            "x": 0,
            "y": 0,
            "h": 10,
            "w": 10,
        },
        "title": "panel",
        "type": "text",
        "version": 0,
    }))
all = grafana.oss.get_library_panels()
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"title":       "test name",
			"type":        "text",
			"version":     0,
			"description": "test description",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = oss.NewLibraryPanel(ctx, "test", &oss.LibraryPanelArgs{
			Name:      pulumi.String("panelname"),
			ModelJson: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		testFolder, err := oss.NewFolder(ctx, "test", &oss.FolderArgs{
			Title: pulumi.String("Panel Folder"),
			Uid:   pulumi.String("panelname-folder"),
		})
		if err != nil {
			return err
		}
		tmpJSON1, err := json.Marshal(map[string]interface{}{
			"gridPos": map[string]interface{}{
				"x": 0,
				"y": 0,
				"h": 10,
				"w": 10,
			},
			"title":   "panel",
			"type":    "text",
			"version": 0,
		})
		if err != nil {
			return err
		}
		json1 := string(tmpJSON1)
		_, err = oss.NewLibraryPanel(ctx, "folder", &oss.LibraryPanelArgs{
			Name:      pulumi.String("panelname In Folder"),
			FolderUid: testFolder.Uid,
			ModelJson: pulumi.String(json1),
		})
		if err != nil {
			return err
		}
		_, err = oss.GetLibraryPanels(ctx, &oss.GetLibraryPanelsArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var test = new Grafana.Oss.LibraryPanel("test", new()
    {
        Name = "panelname",
        ModelJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["title"] = "test name",
            ["type"] = "text",
            ["version"] = 0,
            ["description"] = "test description",
        }),
    });

    var testFolder = new Grafana.Oss.Folder("test", new()
    {
        Title = "Panel Folder",
        Uid = "panelname-folder",
    });

    var folder = new Grafana.Oss.LibraryPanel("folder", new()
    {
        Name = "panelname In Folder",
        FolderUid = testFolder.Uid,
        ModelJson = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["gridPos"] = new Dictionary<string, object?>
            {
                ["x"] = 0,
                ["y"] = 0,
                ["h"] = 10,
                ["w"] = 10,
            },
            ["title"] = "panel",
            ["type"] = "text",
            ["version"] = 0,
        }),
    });

    var all = Grafana.Oss.GetLibraryPanels.Invoke();

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.LibraryPanel;
import com.pulumi.grafana.oss.LibraryPanelArgs;
import com.pulumi.grafana.oss.Folder;
import com.pulumi.grafana.oss.FolderArgs;
import com.pulumi.grafana.oss.OssFunctions;
import com.pulumi.grafana.oss.inputs.GetLibraryPanelsArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 test = new LibraryPanel("test", LibraryPanelArgs.builder()
            .name("panelname")
            .modelJson(serializeJson(
                jsonObject(
                    jsonProperty("title", "test name"),
                    jsonProperty("type", "text"),
                    jsonProperty("version", 0),
                    jsonProperty("description", "test description")
                )))
            .build());

        var testFolder = new Folder("testFolder", FolderArgs.builder()
            .title("Panel Folder")
            .uid("panelname-folder")
            .build());

        var folder = new LibraryPanel("folder", LibraryPanelArgs.builder()
            .name("panelname In Folder")
            .folderUid(testFolder.uid())
            .modelJson(serializeJson(
                jsonObject(
                    jsonProperty("gridPos", jsonObject(
                        jsonProperty("x", 0),
                        jsonProperty("y", 0),
                        jsonProperty("h", 10),
                        jsonProperty("w", 10)
                    )),
                    jsonProperty("title", "panel"),
                    jsonProperty("type", "text"),
                    jsonProperty("version", 0)
                )))
            .build());

        final var all = OssFunctions.getLibraryPanels();

    }
}
Copy
resources:
  test:
    type: grafana:oss:LibraryPanel
    properties:
      name: panelname
      modelJson:
        fn::toJSON:
          title: test name
          type: text
          version: 0
          description: test description
  testFolder:
    type: grafana:oss:Folder
    name: test
    properties:
      title: Panel Folder
      uid: panelname-folder
  folder:
    type: grafana:oss:LibraryPanel
    properties:
      name: panelname In Folder
      folderUid: ${testFolder.uid}
      modelJson:
        fn::toJSON:
          gridPos:
            x: 0
            y: 0
            h: 10
            w: 10
          title: panel
          type: text
          version: 0
variables:
  all:
    fn::invoke:
      function: grafana:oss:getLibraryPanels
      arguments: {}
Copy

Using getLibraryPanels

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 getLibraryPanels(args: GetLibraryPanelsArgs, opts?: InvokeOptions): Promise<GetLibraryPanelsResult>
function getLibraryPanelsOutput(args: GetLibraryPanelsOutputArgs, opts?: InvokeOptions): Output<GetLibraryPanelsResult>
Copy
def get_library_panels(org_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetLibraryPanelsResult
def get_library_panels_output(org_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetLibraryPanelsResult]
Copy
func GetLibraryPanels(ctx *Context, args *GetLibraryPanelsArgs, opts ...InvokeOption) (*GetLibraryPanelsResult, error)
func GetLibraryPanelsOutput(ctx *Context, args *GetLibraryPanelsOutputArgs, opts ...InvokeOption) GetLibraryPanelsResultOutput
Copy

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

public static class GetLibraryPanels 
{
    public static Task<GetLibraryPanelsResult> InvokeAsync(GetLibraryPanelsArgs args, InvokeOptions? opts = null)
    public static Output<GetLibraryPanelsResult> Invoke(GetLibraryPanelsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLibraryPanelsResult> getLibraryPanels(GetLibraryPanelsArgs args, InvokeOptions options)
public static Output<GetLibraryPanelsResult> getLibraryPanels(GetLibraryPanelsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: grafana:index/getLibraryPanels:getLibraryPanels
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

OrgId string
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
OrgId string
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
orgId String
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
orgId string
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
org_id str
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
orgId String
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.

getLibraryPanels Result

The following output properties are available:

Id string
The ID of this resource.
OrgId string
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
Panels List<Pulumiverse.Grafana.Outputs.GetLibraryPanelsPanel>
Id string
The ID of this resource.
OrgId string
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
Panels []GetLibraryPanelsPanel
id String
The ID of this resource.
orgId String
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
panels List<GetLibraryPanelsPanel>
id string
The ID of this resource.
orgId string
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
panels GetLibraryPanelsPanel[]
id str
The ID of this resource.
org_id str
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
panels Sequence[GetLibraryPanelsPanel]
id String
The ID of this resource.
orgId String
The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
panels List<Property Map>

Supporting Types

GetLibraryPanelsPanel

Description This property is required. string
FolderUid This property is required. string
ModelJson This property is required. string
Name This property is required. string
Uid This property is required. string
Description This property is required. string
FolderUid This property is required. string
ModelJson This property is required. string
Name This property is required. string
Uid This property is required. string
description This property is required. String
folderUid This property is required. String
modelJson This property is required. String
name This property is required. String
uid This property is required. String
description This property is required. string
folderUid This property is required. string
modelJson This property is required. string
name This property is required. string
uid This property is required. string
description This property is required. str
folder_uid This property is required. str
model_json This property is required. str
name This property is required. str
uid This property is required. str
description This property is required. String
folderUid This property is required. String
modelJson This property is required. String
name This property is required. String
uid This property is required. String

Package Details

Repository
grafana pulumiverse/pulumi-grafana
License
Apache-2.0
Notes
This Pulumi package is based on the grafana Terraform Provider.
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse