Grafana v0.16.1 published on Saturday, Mar 15, 2025 by pulumiverse
grafana.getLibraryPanels
Explore with Pulumi AI
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({});
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()
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
	})
}
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();
});
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();
    }
}
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: {}
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>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]func GetLibraryPanels(ctx *Context, args *GetLibraryPanelsArgs, opts ...InvokeOption) (*GetLibraryPanelsResult, error)
func GetLibraryPanelsOutput(ctx *Context, args *GetLibraryPanelsOutputArgs, opts ...InvokeOption) GetLibraryPanelsResultOutput> 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)
}public static CompletableFuture<GetLibraryPanelsResult> getLibraryPanels(GetLibraryPanelsArgs args, InvokeOptions options)
public static Output<GetLibraryPanelsResult> getLibraryPanels(GetLibraryPanelsArgs args, InvokeOptions options)
fn::invoke:
  function: grafana:index/getLibraryPanels:getLibraryPanels
  arguments:
    # arguments dictionaryThe 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. Get Library Panels Panel> 
- 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
[]GetLibrary Panels Panel 
- 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<GetLibrary Panels Panel> 
- 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
GetLibrary Panels Panel[] 
- 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[GetLibrary Panels Panel] 
- 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 string
- FolderUid string
- ModelJson string
- Name string
- Uid string
- Description string
- FolderUid string
- ModelJson string
- Name string
- Uid string
- description String
- folderUid String
- modelJson String
- name String
- uid String
- description string
- folderUid string
- modelJson string
- name string
- uid string
- description str
- folder_uid str
- model_json str
- name str
- uid str
- description String
- folderUid String
- modelJson String
- name String
- uid String
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the grafanaTerraform Provider.
