-
Notifications
You must be signed in to change notification settings - Fork 51
/
portalDashboard.go
302 lines (251 loc) · 12.9 KB
/
portalDashboard.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package portal
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Import
//
// Dashboards can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:portal/portalDashboard:PortalDashboard 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.
type PortalDashboard 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. Changing this forces a new resource to be created.
//
// > **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewPortalDashboard registers a new resource with the given unique name, arguments, and options.
func NewPortalDashboard(ctx *pulumi.Context,
name string, args *PortalDashboardArgs, opts ...pulumi.ResourceOption) (*PortalDashboard, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DashboardProperties == nil {
return nil, errors.New("invalid value for required argument 'DashboardProperties'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource PortalDashboard
err := ctx.RegisterResource("azure:portal/portalDashboard:PortalDashboard", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPortalDashboard gets an existing PortalDashboard 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 GetPortalDashboard(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PortalDashboardState, opts ...pulumi.ResourceOption) (*PortalDashboard, error) {
var resource PortalDashboard
err := ctx.ReadResource("azure:portal/portalDashboard:PortalDashboard", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering PortalDashboard resources.
type portalDashboardState struct {
// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
DashboardProperties *string `pulumi:"dashboardProperties"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Shared Dashboard. Changing this forces a new resource to be created.
//
// > **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
Name *string `pulumi:"name"`
// The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
type PortalDashboardState 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. Changing this forces a new resource to be created.
//
// > **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
Name pulumi.StringPtrInput
// The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (PortalDashboardState) ElementType() reflect.Type {
return reflect.TypeOf((*portalDashboardState)(nil)).Elem()
}
type portalDashboardArgs struct {
// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
DashboardProperties string `pulumi:"dashboardProperties"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// Specifies the name of the Shared Dashboard. Changing this forces a new resource to be created.
//
// > **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
Name *string `pulumi:"name"`
// The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a PortalDashboard resource.
type PortalDashboardArgs struct {
// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
DashboardProperties pulumi.StringInput
// 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. Changing this forces a new resource to be created.
//
// > **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
Name pulumi.StringPtrInput
// The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (PortalDashboardArgs) ElementType() reflect.Type {
return reflect.TypeOf((*portalDashboardArgs)(nil)).Elem()
}
type PortalDashboardInput interface {
pulumi.Input
ToPortalDashboardOutput() PortalDashboardOutput
ToPortalDashboardOutputWithContext(ctx context.Context) PortalDashboardOutput
}
func (*PortalDashboard) ElementType() reflect.Type {
return reflect.TypeOf((**PortalDashboard)(nil)).Elem()
}
func (i *PortalDashboard) ToPortalDashboardOutput() PortalDashboardOutput {
return i.ToPortalDashboardOutputWithContext(context.Background())
}
func (i *PortalDashboard) ToPortalDashboardOutputWithContext(ctx context.Context) PortalDashboardOutput {
return pulumi.ToOutputWithContext(ctx, i).(PortalDashboardOutput)
}
// PortalDashboardArrayInput is an input type that accepts PortalDashboardArray and PortalDashboardArrayOutput values.
// You can construct a concrete instance of `PortalDashboardArrayInput` via:
//
// PortalDashboardArray{ PortalDashboardArgs{...} }
type PortalDashboardArrayInput interface {
pulumi.Input
ToPortalDashboardArrayOutput() PortalDashboardArrayOutput
ToPortalDashboardArrayOutputWithContext(context.Context) PortalDashboardArrayOutput
}
type PortalDashboardArray []PortalDashboardInput
func (PortalDashboardArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PortalDashboard)(nil)).Elem()
}
func (i PortalDashboardArray) ToPortalDashboardArrayOutput() PortalDashboardArrayOutput {
return i.ToPortalDashboardArrayOutputWithContext(context.Background())
}
func (i PortalDashboardArray) ToPortalDashboardArrayOutputWithContext(ctx context.Context) PortalDashboardArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PortalDashboardArrayOutput)
}
// PortalDashboardMapInput is an input type that accepts PortalDashboardMap and PortalDashboardMapOutput values.
// You can construct a concrete instance of `PortalDashboardMapInput` via:
//
// PortalDashboardMap{ "key": PortalDashboardArgs{...} }
type PortalDashboardMapInput interface {
pulumi.Input
ToPortalDashboardMapOutput() PortalDashboardMapOutput
ToPortalDashboardMapOutputWithContext(context.Context) PortalDashboardMapOutput
}
type PortalDashboardMap map[string]PortalDashboardInput
func (PortalDashboardMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PortalDashboard)(nil)).Elem()
}
func (i PortalDashboardMap) ToPortalDashboardMapOutput() PortalDashboardMapOutput {
return i.ToPortalDashboardMapOutputWithContext(context.Background())
}
func (i PortalDashboardMap) ToPortalDashboardMapOutputWithContext(ctx context.Context) PortalDashboardMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PortalDashboardMapOutput)
}
type PortalDashboardOutput struct{ *pulumi.OutputState }
func (PortalDashboardOutput) ElementType() reflect.Type {
return reflect.TypeOf((**PortalDashboard)(nil)).Elem()
}
func (o PortalDashboardOutput) ToPortalDashboardOutput() PortalDashboardOutput {
return o
}
func (o PortalDashboardOutput) ToPortalDashboardOutputWithContext(ctx context.Context) PortalDashboardOutput {
return o
}
// JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
func (o PortalDashboardOutput) DashboardProperties() pulumi.StringOutput {
return o.ApplyT(func(v *PortalDashboard) pulumi.StringOutput { return v.DashboardProperties }).(pulumi.StringOutput)
}
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
func (o PortalDashboardOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *PortalDashboard) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Specifies the name of the Shared Dashboard. Changing this forces a new resource to be created.
//
// > **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
func (o PortalDashboardOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *PortalDashboard) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
func (o PortalDashboardOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *PortalDashboard) pulumi.StringOutput { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A mapping of tags to assign to the resource.
func (o PortalDashboardOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *PortalDashboard) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
type PortalDashboardArrayOutput struct{ *pulumi.OutputState }
func (PortalDashboardArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*PortalDashboard)(nil)).Elem()
}
func (o PortalDashboardArrayOutput) ToPortalDashboardArrayOutput() PortalDashboardArrayOutput {
return o
}
func (o PortalDashboardArrayOutput) ToPortalDashboardArrayOutputWithContext(ctx context.Context) PortalDashboardArrayOutput {
return o
}
func (o PortalDashboardArrayOutput) Index(i pulumi.IntInput) PortalDashboardOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PortalDashboard {
return vs[0].([]*PortalDashboard)[vs[1].(int)]
}).(PortalDashboardOutput)
}
type PortalDashboardMapOutput struct{ *pulumi.OutputState }
func (PortalDashboardMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*PortalDashboard)(nil)).Elem()
}
func (o PortalDashboardMapOutput) ToPortalDashboardMapOutput() PortalDashboardMapOutput {
return o
}
func (o PortalDashboardMapOutput) ToPortalDashboardMapOutputWithContext(ctx context.Context) PortalDashboardMapOutput {
return o
}
func (o PortalDashboardMapOutput) MapIndex(k pulumi.StringInput) PortalDashboardOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PortalDashboard {
return vs[0].(map[string]*PortalDashboard)[vs[1].(string)]
}).(PortalDashboardOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PortalDashboardInput)(nil)).Elem(), &PortalDashboard{})
pulumi.RegisterInputType(reflect.TypeOf((*PortalDashboardArrayInput)(nil)).Elem(), PortalDashboardArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PortalDashboardMapInput)(nil)).Elem(), PortalDashboardMap{})
pulumi.RegisterOutputType(PortalDashboardOutput{})
pulumi.RegisterOutputType(PortalDashboardArrayOutput{})
pulumi.RegisterOutputType(PortalDashboardMapOutput{})
}