This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
dashboard.go
146 lines (133 loc) · 4.33 KB
/
dashboard.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20190101preview
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The shared dashboard resource definition.
type Dashboard struct {
pulumi.CustomResourceState
// The dashboard lenses.
Lenses DashboardLensResponseMapOutput `pulumi:"lenses"`
// Resource location
Location pulumi.StringOutput `pulumi:"location"`
// The dashboard metadata.
Metadata pulumi.MapOutput `pulumi:"metadata"`
// Resource name
Name pulumi.StringOutput `pulumi:"name"`
// Resource tags
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Resource type
Type pulumi.StringOutput `pulumi:"type"`
}
// NewDashboard registers a new resource with the given unique name, arguments, and options.
func NewDashboard(ctx *pulumi.Context,
name string, args *DashboardArgs, opts ...pulumi.ResourceOption) (*Dashboard, error) {
if args == nil || args.DashboardName == nil {
return nil, errors.New("missing required argument 'DashboardName'")
}
if args == nil || args.Location == nil {
return nil, errors.New("missing required argument 'Location'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil {
args = &DashboardArgs{}
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:portal/v20150801preview:Dashboard"),
},
{
Type: pulumi.String("azure-nextgen:portal/v20181001preview:Dashboard"),
},
{
Type: pulumi.String("azure-nextgen:portal/v20200901preview:Dashboard"),
},
})
opts = append(opts, aliases)
var resource Dashboard
err := ctx.RegisterResource("azure-nextgen:portal/v20190101preview:Dashboard", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// 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 GetDashboard(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DashboardState, opts ...pulumi.ResourceOption) (*Dashboard, error) {
var resource Dashboard
err := ctx.ReadResource("azure-nextgen:portal/v20190101preview:Dashboard", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Dashboard resources.
type dashboardState struct {
// The dashboard lenses.
Lenses map[string]DashboardLensResponse `pulumi:"lenses"`
// Resource location
Location *string `pulumi:"location"`
// The dashboard metadata.
Metadata map[string]interface{} `pulumi:"metadata"`
// Resource name
Name *string `pulumi:"name"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// Resource type
Type *string `pulumi:"type"`
}
type DashboardState struct {
// The dashboard lenses.
Lenses DashboardLensResponseMapInput
// Resource location
Location pulumi.StringPtrInput
// The dashboard metadata.
Metadata pulumi.MapInput
// Resource name
Name pulumi.StringPtrInput
// Resource tags
Tags pulumi.StringMapInput
// Resource type
Type pulumi.StringPtrInput
}
func (DashboardState) ElementType() reflect.Type {
return reflect.TypeOf((*dashboardState)(nil)).Elem()
}
type dashboardArgs struct {
// The name of the dashboard.
DashboardName string `pulumi:"dashboardName"`
// The dashboard lenses.
Lenses map[string]DashboardLens `pulumi:"lenses"`
// Resource location
Location string `pulumi:"location"`
// The dashboard metadata.
Metadata map[string]interface{} `pulumi:"metadata"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Dashboard resource.
type DashboardArgs struct {
// The name of the dashboard.
DashboardName pulumi.StringInput
// The dashboard lenses.
Lenses DashboardLensMapInput
// Resource location
Location pulumi.StringInput
// The dashboard metadata.
Metadata pulumi.MapInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// Resource tags
Tags pulumi.StringMapInput
}
func (DashboardArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dashboardArgs)(nil)).Elem()
}