1. Packages
  2. Grafana Cloud
  3. API Docs
  4. LibraryPanel
Grafana v0.7.0 published on Tuesday, Nov 5, 2024 by pulumiverse

grafana.LibraryPanel

Explore with Pulumi AI

grafana logo
Grafana v0.7.0 published on Tuesday, Nov 5, 2024 by pulumiverse
    Deprecated: grafana.index/librarypanel.LibraryPanel has been deprecated in favor of grafana.oss/librarypanel.LibraryPanel

    Manages Grafana library panels.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const test = new grafana.oss.LibraryPanel("test", {
        name: "panel",
        modelJson: JSON.stringify({
            gridPos: {
                x: 0,
                y: 0,
                h: 10,
                w: 10,
            },
            title: "panel",
            type: "text",
            version: 0,
        }),
    });
    
    import pulumi
    import json
    import pulumiverse_grafana as grafana
    
    test = grafana.oss.LibraryPanel("test",
        name="panel",
        model_json=json.dumps({
            "gridPos": {
                "x": 0,
                "y": 0,
                "h": 10,
                "w": 10,
            },
            "title": "panel",
            "type": "text",
            "version": 0,
        }))
    
    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{}{
    			"gridPos": map[string]interface{}{
    				"x": 0,
    				"y": 0,
    				"h": 10,
    				"w": 10,
    			},
    			"title":   "panel",
    			"type":    "text",
    			"version": 0,
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = oss.NewLibraryPanel(ctx, "test", &oss.LibraryPanelArgs{
    			Name:      pulumi.String("panel"),
    			ModelJson: pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Grafana.Oss.LibraryPanel("test", new()
        {
            Name = "panel",
            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,
            }),
        });
    
    });
    
    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 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("panel")
                .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());
    
        }
    }
    
    resources:
      test:
        type: grafana:oss:LibraryPanel
        properties:
          name: panel
          modelJson:
            fn::toJSON:
              gridPos:
                x: 0
                y: 0
                h: 10
                w: 10
              title: panel
              type: text
              version: 0
    

    Create LibraryPanel Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new LibraryPanel(name: string, args: LibraryPanelArgs, opts?: CustomResourceOptions);
    @overload
    def LibraryPanel(resource_name: str,
                     args: LibraryPanelArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def LibraryPanel(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     folder_uid: Optional[str] = None,
                     model_json: Optional[str] = None,
                     name: Optional[str] = None,
                     org_id: Optional[str] = None,
                     uid: Optional[str] = None)
    func NewLibraryPanel(ctx *Context, name string, args LibraryPanelArgs, opts ...ResourceOption) (*LibraryPanel, error)
    public LibraryPanel(string name, LibraryPanelArgs args, CustomResourceOptions? opts = null)
    public LibraryPanel(String name, LibraryPanelArgs args)
    public LibraryPanel(String name, LibraryPanelArgs args, CustomResourceOptions options)
    
    type: grafana:LibraryPanel
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args LibraryPanelArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args LibraryPanelArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args LibraryPanelArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LibraryPanelArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LibraryPanelArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    LibraryPanel Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The LibraryPanel resource accepts the following input properties:

    ModelJson string
    The JSON model for the library panel.
    FolderUid string
    Unique ID (UID) of the folder containing the library panel.
    Name string
    Name of the library panel.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    Uid string
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    ModelJson string
    The JSON model for the library panel.
    FolderUid string
    Unique ID (UID) of the folder containing the library panel.
    Name string
    Name of the library panel.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    Uid string
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    modelJson String
    The JSON model for the library panel.
    folderUid String
    Unique ID (UID) of the folder containing the library panel.
    name String
    Name of the library panel.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    uid String
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    modelJson string
    The JSON model for the library panel.
    folderUid string
    Unique ID (UID) of the folder containing the library panel.
    name string
    Name of the library panel.
    orgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    uid string
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    model_json str
    The JSON model for the library panel.
    folder_uid str
    Unique ID (UID) of the folder containing the library panel.
    name str
    Name of the library panel.
    org_id str
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    uid str
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    modelJson String
    The JSON model for the library panel.
    folderUid String
    Unique ID (UID) of the folder containing the library panel.
    name String
    Name of the library panel.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    uid String
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LibraryPanel resource produces the following output properties:

    Created string
    Timestamp when the library panel was created.
    DashboardIds List<int>
    Numerical IDs of Grafana dashboards containing the library panel.
    Description string
    Description of the library panel.
    FolderName string
    Name of the folder containing the library panel.
    Id string
    The provider-assigned unique ID for this managed resource.
    PanelId int
    The numeric ID of the library panel computed by Grafana.
    Type string
    Type of the library panel (eg. text).
    Updated string
    Timestamp when the library panel was last modified.
    Version int
    Version of the library panel.
    Created string
    Timestamp when the library panel was created.
    DashboardIds []int
    Numerical IDs of Grafana dashboards containing the library panel.
    Description string
    Description of the library panel.
    FolderName string
    Name of the folder containing the library panel.
    Id string
    The provider-assigned unique ID for this managed resource.
    PanelId int
    The numeric ID of the library panel computed by Grafana.
    Type string
    Type of the library panel (eg. text).
    Updated string
    Timestamp when the library panel was last modified.
    Version int
    Version of the library panel.
    created String
    Timestamp when the library panel was created.
    dashboardIds List<Integer>
    Numerical IDs of Grafana dashboards containing the library panel.
    description String
    Description of the library panel.
    folderName String
    Name of the folder containing the library panel.
    id String
    The provider-assigned unique ID for this managed resource.
    panelId Integer
    The numeric ID of the library panel computed by Grafana.
    type String
    Type of the library panel (eg. text).
    updated String
    Timestamp when the library panel was last modified.
    version Integer
    Version of the library panel.
    created string
    Timestamp when the library panel was created.
    dashboardIds number[]
    Numerical IDs of Grafana dashboards containing the library panel.
    description string
    Description of the library panel.
    folderName string
    Name of the folder containing the library panel.
    id string
    The provider-assigned unique ID for this managed resource.
    panelId number
    The numeric ID of the library panel computed by Grafana.
    type string
    Type of the library panel (eg. text).
    updated string
    Timestamp when the library panel was last modified.
    version number
    Version of the library panel.
    created str
    Timestamp when the library panel was created.
    dashboard_ids Sequence[int]
    Numerical IDs of Grafana dashboards containing the library panel.
    description str
    Description of the library panel.
    folder_name str
    Name of the folder containing the library panel.
    id str
    The provider-assigned unique ID for this managed resource.
    panel_id int
    The numeric ID of the library panel computed by Grafana.
    type str
    Type of the library panel (eg. text).
    updated str
    Timestamp when the library panel was last modified.
    version int
    Version of the library panel.
    created String
    Timestamp when the library panel was created.
    dashboardIds List<Number>
    Numerical IDs of Grafana dashboards containing the library panel.
    description String
    Description of the library panel.
    folderName String
    Name of the folder containing the library panel.
    id String
    The provider-assigned unique ID for this managed resource.
    panelId Number
    The numeric ID of the library panel computed by Grafana.
    type String
    Type of the library panel (eg. text).
    updated String
    Timestamp when the library panel was last modified.
    version Number
    Version of the library panel.

    Look up Existing LibraryPanel Resource

    Get an existing LibraryPanel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: LibraryPanelState, opts?: CustomResourceOptions): LibraryPanel
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created: Optional[str] = None,
            dashboard_ids: Optional[Sequence[int]] = None,
            description: Optional[str] = None,
            folder_name: Optional[str] = None,
            folder_uid: Optional[str] = None,
            model_json: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            panel_id: Optional[int] = None,
            type: Optional[str] = None,
            uid: Optional[str] = None,
            updated: Optional[str] = None,
            version: Optional[int] = None) -> LibraryPanel
    func GetLibraryPanel(ctx *Context, name string, id IDInput, state *LibraryPanelState, opts ...ResourceOption) (*LibraryPanel, error)
    public static LibraryPanel Get(string name, Input<string> id, LibraryPanelState? state, CustomResourceOptions? opts = null)
    public static LibraryPanel get(String name, Output<String> id, LibraryPanelState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Created string
    Timestamp when the library panel was created.
    DashboardIds List<int>
    Numerical IDs of Grafana dashboards containing the library panel.
    Description string
    Description of the library panel.
    FolderName string
    Name of the folder containing the library panel.
    FolderUid string
    Unique ID (UID) of the folder containing the library panel.
    ModelJson string
    The JSON model for the library panel.
    Name string
    Name of the library panel.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    PanelId int
    The numeric ID of the library panel computed by Grafana.
    Type string
    Type of the library panel (eg. text).
    Uid string
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    Updated string
    Timestamp when the library panel was last modified.
    Version int
    Version of the library panel.
    Created string
    Timestamp when the library panel was created.
    DashboardIds []int
    Numerical IDs of Grafana dashboards containing the library panel.
    Description string
    Description of the library panel.
    FolderName string
    Name of the folder containing the library panel.
    FolderUid string
    Unique ID (UID) of the folder containing the library panel.
    ModelJson string
    The JSON model for the library panel.
    Name string
    Name of the library panel.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    PanelId int
    The numeric ID of the library panel computed by Grafana.
    Type string
    Type of the library panel (eg. text).
    Uid string
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    Updated string
    Timestamp when the library panel was last modified.
    Version int
    Version of the library panel.
    created String
    Timestamp when the library panel was created.
    dashboardIds List<Integer>
    Numerical IDs of Grafana dashboards containing the library panel.
    description String
    Description of the library panel.
    folderName String
    Name of the folder containing the library panel.
    folderUid String
    Unique ID (UID) of the folder containing the library panel.
    modelJson String
    The JSON model for the library panel.
    name String
    Name of the library panel.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId Integer
    The numeric ID of the library panel computed by Grafana.
    type String
    Type of the library panel (eg. text).
    uid String
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    updated String
    Timestamp when the library panel was last modified.
    version Integer
    Version of the library panel.
    created string
    Timestamp when the library panel was created.
    dashboardIds number[]
    Numerical IDs of Grafana dashboards containing the library panel.
    description string
    Description of the library panel.
    folderName string
    Name of the folder containing the library panel.
    folderUid string
    Unique ID (UID) of the folder containing the library panel.
    modelJson string
    The JSON model for the library panel.
    name string
    Name of the library panel.
    orgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId number
    The numeric ID of the library panel computed by Grafana.
    type string
    Type of the library panel (eg. text).
    uid string
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    updated string
    Timestamp when the library panel was last modified.
    version number
    Version of the library panel.
    created str
    Timestamp when the library panel was created.
    dashboard_ids Sequence[int]
    Numerical IDs of Grafana dashboards containing the library panel.
    description str
    Description of the library panel.
    folder_name str
    Name of the folder containing the library panel.
    folder_uid str
    Unique ID (UID) of the folder containing the library panel.
    model_json str
    The JSON model for the library panel.
    name str
    Name of the library panel.
    org_id str
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panel_id int
    The numeric ID of the library panel computed by Grafana.
    type str
    Type of the library panel (eg. text).
    uid str
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    updated str
    Timestamp when the library panel was last modified.
    version int
    Version of the library panel.
    created String
    Timestamp when the library panel was created.
    dashboardIds List<Number>
    Numerical IDs of Grafana dashboards containing the library panel.
    description String
    Description of the library panel.
    folderName String
    Name of the folder containing the library panel.
    folderUid String
    Unique ID (UID) of the folder containing the library panel.
    modelJson String
    The JSON model for the library panel.
    name String
    Name of the library panel.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId Number
    The numeric ID of the library panel computed by Grafana.
    type String
    Type of the library panel (eg. text).
    uid String
    The unique identifier (UID) of a library panel uniquely identifies library panels between multiple Grafana installs. It’s automatically generated unless you specify it during library panel creation.The UID provides consistent URLs for accessing library panels and when syncing library panels between multiple Grafana installs.
    updated String
    Timestamp when the library panel was last modified.
    version Number
    Version of the library panel.

    Import

    $ pulumi import grafana:index/libraryPanel:LibraryPanel name "{{ uid }}"
    
    $ pulumi import grafana:index/libraryPanel:LibraryPanel name "{{ orgID }}:{{ uid }}"
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.7.0 published on Tuesday, Nov 5, 2024 by pulumiverse