This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
dataSource.go
198 lines (174 loc) · 6.42 KB
/
dataSource.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
// *** 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 latest
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Datasources under OMS Workspace.
// Latest API Version: 2020-08-01.
type DataSource struct {
pulumi.CustomResourceState
// The ETag of the data source.
Etag pulumi.StringPtrOutput `pulumi:"etag"`
// The kind of the DataSource.
Kind pulumi.StringOutput `pulumi:"kind"`
// The name of the resource
Name pulumi.StringOutput `pulumi:"name"`
// The data source properties in raw json format, each kind of data source have it's own schema.
Properties pulumi.AnyOutput `pulumi:"properties"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type pulumi.StringOutput `pulumi:"type"`
}
// NewDataSource registers a new resource with the given unique name, arguments, and options.
func NewDataSource(ctx *pulumi.Context,
name string, args *DataSourceArgs, opts ...pulumi.ResourceOption) (*DataSource, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DataSourceName == nil {
return nil, errors.New("invalid value for required argument 'DataSourceName'")
}
if args.Kind == nil {
return nil, errors.New("invalid value for required argument 'Kind'")
}
if args.Properties == nil {
return nil, errors.New("invalid value for required argument 'Properties'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.WorkspaceName == nil {
return nil, errors.New("invalid value for required argument 'WorkspaceName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:operationalinsights/v20151101preview:DataSource"),
},
{
Type: pulumi.String("azure-nextgen:operationalinsights/v20200301preview:DataSource"),
},
{
Type: pulumi.String("azure-nextgen:operationalinsights/v20200801:DataSource"),
},
})
opts = append(opts, aliases)
var resource DataSource
err := ctx.RegisterResource("azure-nextgen:operationalinsights/latest:DataSource", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDataSource gets an existing DataSource 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 GetDataSource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DataSourceState, opts ...pulumi.ResourceOption) (*DataSource, error) {
var resource DataSource
err := ctx.ReadResource("azure-nextgen:operationalinsights/latest:DataSource", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DataSource resources.
type dataSourceState struct {
// The ETag of the data source.
Etag *string `pulumi:"etag"`
// The kind of the DataSource.
Kind *string `pulumi:"kind"`
// The name of the resource
Name *string `pulumi:"name"`
// The data source properties in raw json format, each kind of data source have it's own schema.
Properties interface{} `pulumi:"properties"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `pulumi:"type"`
}
type DataSourceState struct {
// The ETag of the data source.
Etag pulumi.StringPtrInput
// The kind of the DataSource.
Kind pulumi.StringPtrInput
// The name of the resource
Name pulumi.StringPtrInput
// The data source properties in raw json format, each kind of data source have it's own schema.
Properties pulumi.Input
// Resource tags.
Tags pulumi.StringMapInput
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type pulumi.StringPtrInput
}
func (DataSourceState) ElementType() reflect.Type {
return reflect.TypeOf((*dataSourceState)(nil)).Elem()
}
type dataSourceArgs struct {
// The name of the datasource resource.
DataSourceName string `pulumi:"dataSourceName"`
// The ETag of the data source.
Etag *string `pulumi:"etag"`
// The kind of the DataSource.
Kind string `pulumi:"kind"`
// The data source properties in raw json format, each kind of data source have it's own schema.
Properties interface{} `pulumi:"properties"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// The name of the workspace.
WorkspaceName string `pulumi:"workspaceName"`
}
// The set of arguments for constructing a DataSource resource.
type DataSourceArgs struct {
// The name of the datasource resource.
DataSourceName pulumi.StringInput
// The ETag of the data source.
Etag pulumi.StringPtrInput
// The kind of the DataSource.
Kind pulumi.StringInput
// The data source properties in raw json format, each kind of data source have it's own schema.
Properties pulumi.Input
// The name of the resource group. The name is case insensitive.
ResourceGroupName pulumi.StringInput
// Resource tags.
Tags pulumi.StringMapInput
// The name of the workspace.
WorkspaceName pulumi.StringInput
}
func (DataSourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dataSourceArgs)(nil)).Elem()
}
type DataSourceInput interface {
pulumi.Input
ToDataSourceOutput() DataSourceOutput
ToDataSourceOutputWithContext(ctx context.Context) DataSourceOutput
}
func (*DataSource) ElementType() reflect.Type {
return reflect.TypeOf((*DataSource)(nil))
}
func (i *DataSource) ToDataSourceOutput() DataSourceOutput {
return i.ToDataSourceOutputWithContext(context.Background())
}
func (i *DataSource) ToDataSourceOutputWithContext(ctx context.Context) DataSourceOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataSourceOutput)
}
type DataSourceOutput struct {
*pulumi.OutputState
}
func (DataSourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*DataSource)(nil))
}
func (o DataSourceOutput) ToDataSourceOutput() DataSourceOutput {
return o
}
func (o DataSourceOutput) ToDataSourceOutputWithContext(ctx context.Context) DataSourceOutput {
return o
}
func init() {
pulumi.RegisterOutputType(DataSourceOutput{})
}