generated from pulumi/pulumi-tf-provider-boilerplate
/
getMdbSqlserverCluster.go
272 lines (236 loc) · 12 KB
/
getMdbSqlserverCluster.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
// 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 yandex
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about a Yandex Managed SQLServer cluster. For more information, see
// [the official documentation](https://cloud.yandex.com/docs/managed-sqlserver/).
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-yandex/sdk/go/yandex"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := yandex.GetMdbSqlserverCluster(ctx, &GetMdbSqlserverClusterArgs{
// Name: pulumi.StringRef("test"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("networkId", foo.NetworkId)
// return nil
// })
// }
//
// ```
func GetMdbSqlserverCluster(ctx *pulumi.Context, args *GetMdbSqlserverClusterArgs, opts ...pulumi.InvokeOption) (*GetMdbSqlserverClusterResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetMdbSqlserverClusterResult
err := ctx.Invoke("yandex:index/getMdbSqlserverCluster:getMdbSqlserverCluster", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getMdbSqlserverCluster.
type GetMdbSqlserverClusterArgs struct {
// The ID of the SQLServer cluster.
ClusterId *string `pulumi:"clusterId"`
// Inhibits deletion of the cluster. Can be either `true` or `false`.
DeletionProtection *bool `pulumi:"deletionProtection"`
// The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
FolderId *string `pulumi:"folderId"`
// The name of the SQLServer cluster.
Name *string `pulumi:"name"`
// SQL Collation cluster will be created with. This attribute cannot be changed when cluster is created!
Sqlcollation *string `pulumi:"sqlcollation"`
// SQLServer cluster config.
SqlserverConfig map[string]string `pulumi:"sqlserverConfig"`
}
// A collection of values returned by getMdbSqlserverCluster.
type GetMdbSqlserverClusterResult struct {
BackupWindowStarts []GetMdbSqlserverClusterBackupWindowStart `pulumi:"backupWindowStarts"`
ClusterId string `pulumi:"clusterId"`
// Creation timestamp of the key.
CreatedAt string `pulumi:"createdAt"`
// A database of the SQLServer cluster. The structure is documented below.
Databases []GetMdbSqlserverClusterDatabase `pulumi:"databases"`
// Inhibits deletion of the cluster. Can be either `true` or `false`.
DeletionProtection bool `pulumi:"deletionProtection"`
// Description of the SQLServer cluster.
Description string `pulumi:"description"`
// Deployment environment of the SQLServer cluster.
Environment string `pulumi:"environment"`
FolderId string `pulumi:"folderId"`
// Aggregated health of the cluster.
Health string `pulumi:"health"`
// A list of IDs of the host groups hosting VMs of the cluster.
HostGroupIds []string `pulumi:"hostGroupIds"`
// A host of the SQLServer cluster. The structure is documented below.
Hosts []GetMdbSqlserverClusterHost `pulumi:"hosts"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A set of key/value label pairs to assign to the SQLServer cluster.
Labels map[string]string `pulumi:"labels"`
// The name of the database.
Name string `pulumi:"name"`
// ID of the network, to which the SQLServer cluster belongs.
NetworkId string `pulumi:"networkId"`
// Resources allocated to hosts of the SQLServer cluster. The structure is documented below.
Resources []GetMdbSqlserverClusterResource `pulumi:"resources"`
// A set of ids of security groups assigned to hosts of the cluster.
SecurityGroupIds []string `pulumi:"securityGroupIds"`
// SQL Collation cluster will be created with. This attribute cannot be changed when cluster is created!
Sqlcollation string `pulumi:"sqlcollation"`
// SQLServer cluster config.
SqlserverConfig map[string]string `pulumi:"sqlserverConfig"`
// Status of the cluster.
Status string `pulumi:"status"`
// A user of the SQLServer cluster. The structure is documented below.
Users []GetMdbSqlserverClusterUser `pulumi:"users"`
// Version of the SQLServer cluster.
Version string `pulumi:"version"`
}
func GetMdbSqlserverClusterOutput(ctx *pulumi.Context, args GetMdbSqlserverClusterOutputArgs, opts ...pulumi.InvokeOption) GetMdbSqlserverClusterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetMdbSqlserverClusterResult, error) {
args := v.(GetMdbSqlserverClusterArgs)
r, err := GetMdbSqlserverCluster(ctx, &args, opts...)
var s GetMdbSqlserverClusterResult
if r != nil {
s = *r
}
return s, err
}).(GetMdbSqlserverClusterResultOutput)
}
// A collection of arguments for invoking getMdbSqlserverCluster.
type GetMdbSqlserverClusterOutputArgs struct {
// The ID of the SQLServer cluster.
ClusterId pulumi.StringPtrInput `pulumi:"clusterId"`
// Inhibits deletion of the cluster. Can be either `true` or `false`.
DeletionProtection pulumi.BoolPtrInput `pulumi:"deletionProtection"`
// The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
FolderId pulumi.StringPtrInput `pulumi:"folderId"`
// The name of the SQLServer cluster.
Name pulumi.StringPtrInput `pulumi:"name"`
// SQL Collation cluster will be created with. This attribute cannot be changed when cluster is created!
Sqlcollation pulumi.StringPtrInput `pulumi:"sqlcollation"`
// SQLServer cluster config.
SqlserverConfig pulumi.StringMapInput `pulumi:"sqlserverConfig"`
}
func (GetMdbSqlserverClusterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetMdbSqlserverClusterArgs)(nil)).Elem()
}
// A collection of values returned by getMdbSqlserverCluster.
type GetMdbSqlserverClusterResultOutput struct{ *pulumi.OutputState }
func (GetMdbSqlserverClusterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetMdbSqlserverClusterResult)(nil)).Elem()
}
func (o GetMdbSqlserverClusterResultOutput) ToGetMdbSqlserverClusterResultOutput() GetMdbSqlserverClusterResultOutput {
return o
}
func (o GetMdbSqlserverClusterResultOutput) ToGetMdbSqlserverClusterResultOutputWithContext(ctx context.Context) GetMdbSqlserverClusterResultOutput {
return o
}
func (o GetMdbSqlserverClusterResultOutput) BackupWindowStarts() GetMdbSqlserverClusterBackupWindowStartArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []GetMdbSqlserverClusterBackupWindowStart {
return v.BackupWindowStarts
}).(GetMdbSqlserverClusterBackupWindowStartArrayOutput)
}
func (o GetMdbSqlserverClusterResultOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.ClusterId }).(pulumi.StringOutput)
}
// Creation timestamp of the key.
func (o GetMdbSqlserverClusterResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// A database of the SQLServer cluster. The structure is documented below.
func (o GetMdbSqlserverClusterResultOutput) Databases() GetMdbSqlserverClusterDatabaseArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []GetMdbSqlserverClusterDatabase { return v.Databases }).(GetMdbSqlserverClusterDatabaseArrayOutput)
}
// Inhibits deletion of the cluster. Can be either `true` or `false`.
func (o GetMdbSqlserverClusterResultOutput) DeletionProtection() pulumi.BoolOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) bool { return v.DeletionProtection }).(pulumi.BoolOutput)
}
// Description of the SQLServer cluster.
func (o GetMdbSqlserverClusterResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Description }).(pulumi.StringOutput)
}
// Deployment environment of the SQLServer cluster.
func (o GetMdbSqlserverClusterResultOutput) Environment() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Environment }).(pulumi.StringOutput)
}
func (o GetMdbSqlserverClusterResultOutput) FolderId() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.FolderId }).(pulumi.StringOutput)
}
// Aggregated health of the cluster.
func (o GetMdbSqlserverClusterResultOutput) Health() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Health }).(pulumi.StringOutput)
}
// A list of IDs of the host groups hosting VMs of the cluster.
func (o GetMdbSqlserverClusterResultOutput) HostGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []string { return v.HostGroupIds }).(pulumi.StringArrayOutput)
}
// A host of the SQLServer cluster. The structure is documented below.
func (o GetMdbSqlserverClusterResultOutput) Hosts() GetMdbSqlserverClusterHostArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []GetMdbSqlserverClusterHost { return v.Hosts }).(GetMdbSqlserverClusterHostArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetMdbSqlserverClusterResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Id }).(pulumi.StringOutput)
}
// A set of key/value label pairs to assign to the SQLServer cluster.
func (o GetMdbSqlserverClusterResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// The name of the database.
func (o GetMdbSqlserverClusterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Name }).(pulumi.StringOutput)
}
// ID of the network, to which the SQLServer cluster belongs.
func (o GetMdbSqlserverClusterResultOutput) NetworkId() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.NetworkId }).(pulumi.StringOutput)
}
// Resources allocated to hosts of the SQLServer cluster. The structure is documented below.
func (o GetMdbSqlserverClusterResultOutput) Resources() GetMdbSqlserverClusterResourceArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []GetMdbSqlserverClusterResource { return v.Resources }).(GetMdbSqlserverClusterResourceArrayOutput)
}
// A set of ids of security groups assigned to hosts of the cluster.
func (o GetMdbSqlserverClusterResultOutput) SecurityGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)
}
// SQL Collation cluster will be created with. This attribute cannot be changed when cluster is created!
func (o GetMdbSqlserverClusterResultOutput) Sqlcollation() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Sqlcollation }).(pulumi.StringOutput)
}
// SQLServer cluster config.
func (o GetMdbSqlserverClusterResultOutput) SqlserverConfig() pulumi.StringMapOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) map[string]string { return v.SqlserverConfig }).(pulumi.StringMapOutput)
}
// Status of the cluster.
func (o GetMdbSqlserverClusterResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Status }).(pulumi.StringOutput)
}
// A user of the SQLServer cluster. The structure is documented below.
func (o GetMdbSqlserverClusterResultOutput) Users() GetMdbSqlserverClusterUserArrayOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) []GetMdbSqlserverClusterUser { return v.Users }).(GetMdbSqlserverClusterUserArrayOutput)
}
// Version of the SQLServer cluster.
func (o GetMdbSqlserverClusterResultOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v GetMdbSqlserverClusterResult) string { return v.Version }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetMdbSqlserverClusterResultOutput{})
}