dashboard

package
v4.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dashboard

type Dashboard struct {
	pulumi.CustomResourceState

	// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
	DashboardProperties pulumi.StringOutput `pulumi:"dashboardProperties"`
	// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
	Location pulumi.StringOutput `pulumi:"location"`
	// Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
	Name pulumi.StringOutput `pulumi:"name"`
	// The name of the resource group in which to
	// create the dashboard.
	ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
	// A mapping of tags to assign to the resource.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
}

Manages a shared dashboard in the Azure Portal.

## Example Usage

```go package main

import (

"fmt"

"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/dashboard"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		mdContent := "# Hello all :)"
		if param := cfg.Get("mdContent"); param != "" {
			mdContent = param
		}
		videoLink := "https://www.youtube.com/watch?v=......"
		if param := cfg.Get("videoLink"); param != "" {
			videoLink = param
		}
		current, err := core.LookupSubscription(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = core.NewResourceGroup(ctx, "my_group", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		_, err = dashboard.NewDashboard(ctx, "my_board", &dashboard.DashboardArgs{
			ResourceGroupName: my_group.Name,
			Location:          my_group.Location,
			Tags: pulumi.StringMap{
				"source": pulumi.String("managed"),
			},
			DashboardProperties: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "   \"lenses\": {\n", "        \"0\": {\n", "            \"order\": 0,\n", "            \"parts\": {\n", "                \"0\": {\n", "                    \"position\": {\n", "                        \"x\": 0,\n", "                        \"y\": 0,\n", "                        \"rowSpan\": 2,\n", "                        \"colSpan\": 3\n", "                    },\n", "                    \"metadata\": {\n", "                        \"inputs\": [],\n", "                        \"type\": \"Extension/HubsExtension/PartType/MarkdownPart\",\n", "                        \"settings\": {\n", "                            \"content\": {\n", "                                \"settings\": {\n", "                                    \"content\": \"", mdContent, "\",\n", "                                    \"subtitle\": \"\",\n", "                                    \"title\": \"\"\n", "                                }\n", "                            }\n", "                        }\n", "                    }\n", "                },               \n", "                \"1\": {\n", "                    \"position\": {\n", "                        \"x\": 5,\n", "                        \"y\": 0,\n", "                        \"rowSpan\": 4,\n", "                        \"colSpan\": 6\n", "                    },\n", "                    \"metadata\": {\n", "                        \"inputs\": [],\n", "                        \"type\": \"Extension/HubsExtension/PartType/VideoPart\",\n", "                        \"settings\": {\n", "                            \"content\": {\n", "                                \"settings\": {\n", "                                    \"title\": \"Important Information\",\n", "                                    \"subtitle\": \"\",\n", "                                    \"src\": \"", videoLink, "\",\n", "                                    \"autoplay\": true\n", "                                }\n", "                            }\n", "                        }\n", "                    }\n", "                },\n", "                \"2\": {\n", "                    \"position\": {\n", "                        \"x\": 0,\n", "                        \"y\": 4,\n", "                        \"rowSpan\": 4,\n", "                        \"colSpan\": 6\n", "                    },\n", "                    \"metadata\": {\n", "                        \"inputs\": [\n", "                            {\n", "                                \"name\": \"ComponentId\",\n", "                                \"value\": \"/subscriptions/", current.SubscriptionId, "/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp\"\n", "                            }\n", "                        ],\n", "                        \"type\": \"Extension/AppInsightsExtension/PartType/AppMapGalPt\",\n", "                        \"settings\": {},\n", "                        \"asset\": {\n", "                            \"idInputName\": \"ComponentId\",\n", "                            \"type\": \"ApplicationInsights\"\n", "                        }\n", "                    }\n", "                }              \n", "            }\n", "        }\n", "    },\n", "    \"metadata\": {\n", "        \"model\": {\n", "            \"timeRange\": {\n", "                \"value\": {\n", "                    \"relative\": {\n", "                        \"duration\": 24,\n", "                        \"timeUnit\": 1\n", "                    }\n", "                },\n", "                \"type\": \"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange\"\n", "            },\n", "            \"filterLocale\": {\n", "                \"value\": \"en-us\"\n", "            },\n", "            \"filters\": {\n", "                \"value\": {\n", "                    \"MsPortalFx_TimeRange\": {\n", "                        \"model\": {\n", "                            \"format\": \"utc\",\n", "                            \"granularity\": \"auto\",\n", "                            \"relative\": \"24h\"\n", "                        },\n", "                        \"displayCache\": {\n", "                            \"name\": \"UTC Time\",\n", "                            \"value\": \"Past 24 hours\"\n", "                        },\n", "                        \"filteredPartIds\": [\n", "                            \"StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7\"\n", "                        ]\n", "                    }\n", "                }\n", "            }\n", "        }\n", "    }\n", "}\n")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

It is recommended to follow the steps outlined [here](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example.

## Import

Dashboards can be imported using the `resource id`, e.g.

```sh

$ pulumi import azure:dashboard/dashboard:Dashboard my-board /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Portal/dashboards/00000000-0000-0000-0000-000000000000

```

Note the URI in the above sample can be found using the Resource Explorer tool in the Azure Portal.

func GetDashboard

func GetDashboard(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *DashboardState, opts ...pulumi.ResourceOption) (*Dashboard, error)

GetDashboard gets an existing Dashboard resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewDashboard

func NewDashboard(ctx *pulumi.Context,
	name string, args *DashboardArgs, opts ...pulumi.ResourceOption) (*Dashboard, error)

NewDashboard registers a new resource with the given unique name, arguments, and options.

func (*Dashboard) ElementType

func (*Dashboard) ElementType() reflect.Type

func (*Dashboard) ToDashboardOutput

func (i *Dashboard) ToDashboardOutput() DashboardOutput

func (*Dashboard) ToDashboardOutputWithContext

func (i *Dashboard) ToDashboardOutputWithContext(ctx context.Context) DashboardOutput

func (*Dashboard) ToDashboardPtrOutput

func (i *Dashboard) ToDashboardPtrOutput() DashboardPtrOutput

func (*Dashboard) ToDashboardPtrOutputWithContext

func (i *Dashboard) ToDashboardPtrOutputWithContext(ctx context.Context) DashboardPtrOutput

type DashboardArgs

type DashboardArgs struct {
	// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
	DashboardProperties pulumi.StringPtrInput
	// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
	Location pulumi.StringPtrInput
	// Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
	Name pulumi.StringPtrInput
	// The name of the resource group in which to
	// create the dashboard.
	ResourceGroupName pulumi.StringInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.StringMapInput
}

The set of arguments for constructing a Dashboard resource.

func (DashboardArgs) ElementType

func (DashboardArgs) ElementType() reflect.Type

type DashboardArray

type DashboardArray []DashboardInput

func (DashboardArray) ElementType

func (DashboardArray) ElementType() reflect.Type

func (DashboardArray) ToDashboardArrayOutput

func (i DashboardArray) ToDashboardArrayOutput() DashboardArrayOutput

func (DashboardArray) ToDashboardArrayOutputWithContext

func (i DashboardArray) ToDashboardArrayOutputWithContext(ctx context.Context) DashboardArrayOutput

type DashboardArrayInput

type DashboardArrayInput interface {
	pulumi.Input

	ToDashboardArrayOutput() DashboardArrayOutput
	ToDashboardArrayOutputWithContext(context.Context) DashboardArrayOutput
}

DashboardArrayInput is an input type that accepts DashboardArray and DashboardArrayOutput values. You can construct a concrete instance of `DashboardArrayInput` via:

DashboardArray{ DashboardArgs{...} }

type DashboardArrayOutput

type DashboardArrayOutput struct{ *pulumi.OutputState }

func (DashboardArrayOutput) ElementType

func (DashboardArrayOutput) ElementType() reflect.Type

func (DashboardArrayOutput) Index

func (DashboardArrayOutput) ToDashboardArrayOutput

func (o DashboardArrayOutput) ToDashboardArrayOutput() DashboardArrayOutput

func (DashboardArrayOutput) ToDashboardArrayOutputWithContext

func (o DashboardArrayOutput) ToDashboardArrayOutputWithContext(ctx context.Context) DashboardArrayOutput

type DashboardInput

type DashboardInput interface {
	pulumi.Input

	ToDashboardOutput() DashboardOutput
	ToDashboardOutputWithContext(ctx context.Context) DashboardOutput
}

type DashboardMap

type DashboardMap map[string]DashboardInput

func (DashboardMap) ElementType

func (DashboardMap) ElementType() reflect.Type

func (DashboardMap) ToDashboardMapOutput

func (i DashboardMap) ToDashboardMapOutput() DashboardMapOutput

func (DashboardMap) ToDashboardMapOutputWithContext

func (i DashboardMap) ToDashboardMapOutputWithContext(ctx context.Context) DashboardMapOutput

type DashboardMapInput

type DashboardMapInput interface {
	pulumi.Input

	ToDashboardMapOutput() DashboardMapOutput
	ToDashboardMapOutputWithContext(context.Context) DashboardMapOutput
}

DashboardMapInput is an input type that accepts DashboardMap and DashboardMapOutput values. You can construct a concrete instance of `DashboardMapInput` via:

DashboardMap{ "key": DashboardArgs{...} }

type DashboardMapOutput

type DashboardMapOutput struct{ *pulumi.OutputState }

func (DashboardMapOutput) ElementType

func (DashboardMapOutput) ElementType() reflect.Type

func (DashboardMapOutput) MapIndex

func (DashboardMapOutput) ToDashboardMapOutput

func (o DashboardMapOutput) ToDashboardMapOutput() DashboardMapOutput

func (DashboardMapOutput) ToDashboardMapOutputWithContext

func (o DashboardMapOutput) ToDashboardMapOutputWithContext(ctx context.Context) DashboardMapOutput

type DashboardOutput

type DashboardOutput struct{ *pulumi.OutputState }

func (DashboardOutput) ElementType

func (DashboardOutput) ElementType() reflect.Type

func (DashboardOutput) ToDashboardOutput

func (o DashboardOutput) ToDashboardOutput() DashboardOutput

func (DashboardOutput) ToDashboardOutputWithContext

func (o DashboardOutput) ToDashboardOutputWithContext(ctx context.Context) DashboardOutput

func (DashboardOutput) ToDashboardPtrOutput

func (o DashboardOutput) ToDashboardPtrOutput() DashboardPtrOutput

func (DashboardOutput) ToDashboardPtrOutputWithContext

func (o DashboardOutput) ToDashboardPtrOutputWithContext(ctx context.Context) DashboardPtrOutput

type DashboardPtrInput

type DashboardPtrInput interface {
	pulumi.Input

	ToDashboardPtrOutput() DashboardPtrOutput
	ToDashboardPtrOutputWithContext(ctx context.Context) DashboardPtrOutput
}

type DashboardPtrOutput

type DashboardPtrOutput struct{ *pulumi.OutputState }

func (DashboardPtrOutput) Elem added in v4.20.0

func (DashboardPtrOutput) ElementType

func (DashboardPtrOutput) ElementType() reflect.Type

func (DashboardPtrOutput) ToDashboardPtrOutput

func (o DashboardPtrOutput) ToDashboardPtrOutput() DashboardPtrOutput

func (DashboardPtrOutput) ToDashboardPtrOutputWithContext

func (o DashboardPtrOutput) ToDashboardPtrOutputWithContext(ctx context.Context) DashboardPtrOutput

type DashboardState

type DashboardState struct {
	// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
	DashboardProperties pulumi.StringPtrInput
	// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
	Location pulumi.StringPtrInput
	// Specifies the name of the Shared Dashboard. This should be be 64 chars max, only alphanumeric and hyphens (no spaces). For a more friendly display name, add the `hidden-title` tag.
	Name pulumi.StringPtrInput
	// The name of the resource group in which to
	// create the dashboard.
	ResourceGroupName pulumi.StringPtrInput
	// A mapping of tags to assign to the resource.
	Tags pulumi.StringMapInput
}

func (DashboardState) ElementType

func (DashboardState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL