
Grafana v0.0.10, May 21 23

Grafana v0.0.10, May 21 23
grafana.TeamPreferences
Explore with Pulumi AI
!> Deprecated: Use the preferences
attribute of the grafana.Team
resource instead.
Example Usage
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;
return await Deployment.RunAsync(() =>
{
var metrics = new Grafana.Dashboard("metrics", new()
{
ConfigJson = File.ReadAllText("grafana-dashboard.json"),
});
var team = new Grafana.Team("team");
var teamPreferences = new Grafana.TeamPreferences("teamPreferences", new()
{
TeamId = team.Id,
Theme = "dark",
Timezone = "browser",
HomeDashboardId = metrics.DashboardId,
});
});
package main
import (
"os"
"github.com/lbrlabs/pulumi-grafana/sdk/go/grafana"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
metrics, err := grafana.NewDashboard(ctx, "metrics", &grafana.DashboardArgs{
ConfigJson: readFileOrPanic("grafana-dashboard.json"),
})
if err != nil {
return err
}
team, err := grafana.NewTeam(ctx, "team", nil)
if err != nil {
return err
}
_, err = grafana.NewTeamPreferences(ctx, "teamPreferences", &grafana.TeamPreferencesArgs{
TeamId: team.ID(),
Theme: pulumi.String("dark"),
Timezone: pulumi.String("browser"),
HomeDashboardId: metrics.DashboardId,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.Dashboard;
import com.pulumi.grafana.DashboardArgs;
import com.pulumi.grafana.Team;
import com.pulumi.grafana.TeamPreferences;
import com.pulumi.grafana.TeamPreferencesArgs;
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 metrics = new Dashboard("metrics", DashboardArgs.builder()
.configJson(Files.readString(Paths.get("grafana-dashboard.json")))
.build());
var team = new Team("team");
var teamPreferences = new TeamPreferences("teamPreferences", TeamPreferencesArgs.builder()
.teamId(team.id())
.theme("dark")
.timezone("browser")
.homeDashboardId(metrics.dashboardId())
.build());
}
}
import pulumi
import lbrlabs_pulumi_grafana as grafana
metrics = grafana.Dashboard("metrics", config_json=(lambda path: open(path).read())("grafana-dashboard.json"))
team = grafana.Team("team")
team_preferences = grafana.TeamPreferences("teamPreferences",
team_id=team.id,
theme="dark",
timezone="browser",
home_dashboard_id=metrics.dashboard_id)
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as grafana from "@lbrlabs/pulumi-grafana";
const metrics = new grafana.Dashboard("metrics", {configJson: fs.readFileSync("grafana-dashboard.json")});
const team = new grafana.Team("team", {});
const teamPreferences = new grafana.TeamPreferences("teamPreferences", {
teamId: team.id,
theme: "dark",
timezone: "browser",
homeDashboardId: metrics.dashboardId,
});
resources:
metrics:
type: grafana:Dashboard
properties:
configJson:
fn::readFile: grafana-dashboard.json
team:
type: grafana:Team
teamPreferences:
type: grafana:TeamPreferences
properties:
teamId: ${team.id}
theme: dark
timezone: browser
homeDashboardId: ${metrics.dashboardId}
Create TeamPreferences Resource
new TeamPreferences(name: string, args: TeamPreferencesArgs, opts?: CustomResourceOptions);
@overload
def TeamPreferences(resource_name: str,
opts: Optional[ResourceOptions] = None,
home_dashboard_id: Optional[int] = None,
team_id: Optional[int] = None,
theme: Optional[str] = None,
timezone: Optional[str] = None)
@overload
def TeamPreferences(resource_name: str,
args: TeamPreferencesInitArgs,
opts: Optional[ResourceOptions] = None)
func NewTeamPreferences(ctx *Context, name string, args TeamPreferencesArgs, opts ...ResourceOption) (*TeamPreferences, error)
public TeamPreferences(string name, TeamPreferencesArgs args, CustomResourceOptions? opts = null)
public TeamPreferences(String name, TeamPreferencesArgs args)
public TeamPreferences(String name, TeamPreferencesArgs args, CustomResourceOptions options)
type: grafana:TeamPreferences
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TeamPreferencesArgs
- 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 TeamPreferencesInitArgs
- 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 TeamPreferencesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TeamPreferencesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TeamPreferencesArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TeamPreferences Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TeamPreferences resource accepts the following input properties:
- Team
Id int The numeric team ID.
- Home
Dashboard intId The numeric ID of the dashboard to display when a team member logs in.
- Theme string
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- Timezone string
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- Team
Id int The numeric team ID.
- Home
Dashboard intId The numeric ID of the dashboard to display when a team member logs in.
- Theme string
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- Timezone string
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- team
Id Integer The numeric team ID.
- home
Dashboard IntegerId The numeric ID of the dashboard to display when a team member logs in.
- theme String
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone String
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- team
Id number The numeric team ID.
- home
Dashboard numberId The numeric ID of the dashboard to display when a team member logs in.
- theme string
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone string
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- team_
id int The numeric team ID.
- home_
dashboard_ intid The numeric ID of the dashboard to display when a team member logs in.
- theme str
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone str
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- team
Id Number The numeric team ID.
- home
Dashboard NumberId The numeric ID of the dashboard to display when a team member logs in.
- theme String
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone String
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
Outputs
All input properties are implicitly available as output properties. Additionally, the TeamPreferences resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing TeamPreferences Resource
Get an existing TeamPreferences 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?: TeamPreferencesState, opts?: CustomResourceOptions): TeamPreferences
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
home_dashboard_id: Optional[int] = None,
team_id: Optional[int] = None,
theme: Optional[str] = None,
timezone: Optional[str] = None) -> TeamPreferences
func GetTeamPreferences(ctx *Context, name string, id IDInput, state *TeamPreferencesState, opts ...ResourceOption) (*TeamPreferences, error)
public static TeamPreferences Get(string name, Input<string> id, TeamPreferencesState? state, CustomResourceOptions? opts = null)
public static TeamPreferences get(String name, Output<String> id, TeamPreferencesState 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.
- Home
Dashboard intId The numeric ID of the dashboard to display when a team member logs in.
- Team
Id int The numeric team ID.
- Theme string
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- Timezone string
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- Home
Dashboard intId The numeric ID of the dashboard to display when a team member logs in.
- Team
Id int The numeric team ID.
- Theme string
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- Timezone string
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- home
Dashboard IntegerId The numeric ID of the dashboard to display when a team member logs in.
- team
Id Integer The numeric team ID.
- theme String
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone String
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- home
Dashboard numberId The numeric ID of the dashboard to display when a team member logs in.
- team
Id number The numeric team ID.
- theme string
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone string
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- home_
dashboard_ intid The numeric ID of the dashboard to display when a team member logs in.
- team_
id int The numeric team ID.
- theme str
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone str
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
- home
Dashboard NumberId The numeric ID of the dashboard to display when a team member logs in.
- team
Id Number The numeric team ID.
- theme String
The theme for the specified team. Available themes are
light
,dark
, or an empty string for the default theme.- timezone String
The timezone for the specified team. Available values are
utc
,browser
, or an empty string for the default.
Package Details
- Repository
- grafana lbrlabs/pulumi-grafana
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
grafana
Terraform Provider.