/
getDBClusters.go
222 lines (194 loc) · 8.09 KB
/
getDBClusters.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
// 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 adb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the Adb DBClusters of the current Alibaba Cloud user.
//
// > **NOTE:** Available since v1.121.0.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/adb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := adb.GetDBClusters(ctx, &adb.GetDBClustersArgs{
// DescriptionRegex: pulumi.StringRef("example"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstAdbDbClusterId", example.Clusters[0].Id)
// return nil
// })
// }
//
// ```
func GetDBClusters(ctx *pulumi.Context, args *GetDBClustersArgs, opts ...pulumi.InvokeOption) (*GetDBClustersResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetDBClustersResult
err := ctx.Invoke("alicloud:adb/getDBClusters:getDBClusters", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDBClusters.
type GetDBClustersArgs struct {
// The description of DBCluster.
Description *string `pulumi:"description"`
// A regex string to filter results by DBCluster description.
DescriptionRegex *string `pulumi:"descriptionRegex"`
// Default to `false`. Set it to `true` can output more details about resource attributes.
EnableDetails *bool `pulumi:"enableDetails"`
// A list of DBCluster IDs.
Ids []string `pulumi:"ids"`
// File name where to save data source results (after running `pulumi preview`).
OutputFile *string `pulumi:"outputFile"`
PageNumber *int `pulumi:"pageNumber"`
PageSize *int `pulumi:"pageSize"`
// The ID of the resource group.
ResourceGroupId *string `pulumi:"resourceGroupId"`
// The status of the resource.
Status *string `pulumi:"status"`
// A map of tags assigned to the cluster.
Tags map[string]interface{} `pulumi:"tags"`
}
// A collection of values returned by getDBClusters.
type GetDBClustersResult struct {
// A list of Adb Db Clusters. Each element contains the following attributes:
Clusters []GetDBClustersCluster `pulumi:"clusters"`
// The description of DBCluster.
Description *string `pulumi:"description"`
DescriptionRegex *string `pulumi:"descriptionRegex"`
// A list of DBCluster descriptions.
Descriptions []string `pulumi:"descriptions"`
EnableDetails *bool `pulumi:"enableDetails"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Ids []string `pulumi:"ids"`
OutputFile *string `pulumi:"outputFile"`
PageNumber *int `pulumi:"pageNumber"`
PageSize *int `pulumi:"pageSize"`
// The ID of the resource group.
ResourceGroupId *string `pulumi:"resourceGroupId"`
// The status of the resource.
Status *string `pulumi:"status"`
// The tags of the resource.
Tags map[string]interface{} `pulumi:"tags"`
TotalCount int `pulumi:"totalCount"`
}
func GetDBClustersOutput(ctx *pulumi.Context, args GetDBClustersOutputArgs, opts ...pulumi.InvokeOption) GetDBClustersResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetDBClustersResult, error) {
args := v.(GetDBClustersArgs)
r, err := GetDBClusters(ctx, &args, opts...)
var s GetDBClustersResult
if r != nil {
s = *r
}
return s, err
}).(GetDBClustersResultOutput)
}
// A collection of arguments for invoking getDBClusters.
type GetDBClustersOutputArgs struct {
// The description of DBCluster.
Description pulumi.StringPtrInput `pulumi:"description"`
// A regex string to filter results by DBCluster description.
DescriptionRegex pulumi.StringPtrInput `pulumi:"descriptionRegex"`
// Default to `false`. Set it to `true` can output more details about resource attributes.
EnableDetails pulumi.BoolPtrInput `pulumi:"enableDetails"`
// A list of DBCluster IDs.
Ids pulumi.StringArrayInput `pulumi:"ids"`
// File name where to save data source results (after running `pulumi preview`).
OutputFile pulumi.StringPtrInput `pulumi:"outputFile"`
PageNumber pulumi.IntPtrInput `pulumi:"pageNumber"`
PageSize pulumi.IntPtrInput `pulumi:"pageSize"`
// The ID of the resource group.
ResourceGroupId pulumi.StringPtrInput `pulumi:"resourceGroupId"`
// The status of the resource.
Status pulumi.StringPtrInput `pulumi:"status"`
// A map of tags assigned to the cluster.
Tags pulumi.MapInput `pulumi:"tags"`
}
func (GetDBClustersOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetDBClustersArgs)(nil)).Elem()
}
// A collection of values returned by getDBClusters.
type GetDBClustersResultOutput struct{ *pulumi.OutputState }
func (GetDBClustersResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetDBClustersResult)(nil)).Elem()
}
func (o GetDBClustersResultOutput) ToGetDBClustersResultOutput() GetDBClustersResultOutput {
return o
}
func (o GetDBClustersResultOutput) ToGetDBClustersResultOutputWithContext(ctx context.Context) GetDBClustersResultOutput {
return o
}
// A list of Adb Db Clusters. Each element contains the following attributes:
func (o GetDBClustersResultOutput) Clusters() GetDBClustersClusterArrayOutput {
return o.ApplyT(func(v GetDBClustersResult) []GetDBClustersCluster { return v.Clusters }).(GetDBClustersClusterArrayOutput)
}
// The description of DBCluster.
func (o GetDBClustersResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
func (o GetDBClustersResultOutput) DescriptionRegex() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *string { return v.DescriptionRegex }).(pulumi.StringPtrOutput)
}
// A list of DBCluster descriptions.
func (o GetDBClustersResultOutput) Descriptions() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetDBClustersResult) []string { return v.Descriptions }).(pulumi.StringArrayOutput)
}
func (o GetDBClustersResultOutput) EnableDetails() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *bool { return v.EnableDetails }).(pulumi.BoolPtrOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetDBClustersResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetDBClustersResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetDBClustersResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetDBClustersResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
func (o GetDBClustersResultOutput) OutputFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *string { return v.OutputFile }).(pulumi.StringPtrOutput)
}
func (o GetDBClustersResultOutput) PageNumber() pulumi.IntPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *int { return v.PageNumber }).(pulumi.IntPtrOutput)
}
func (o GetDBClustersResultOutput) PageSize() pulumi.IntPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *int { return v.PageSize }).(pulumi.IntPtrOutput)
}
// The ID of the resource group.
func (o GetDBClustersResultOutput) ResourceGroupId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *string { return v.ResourceGroupId }).(pulumi.StringPtrOutput)
}
// The status of the resource.
func (o GetDBClustersResultOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDBClustersResult) *string { return v.Status }).(pulumi.StringPtrOutput)
}
// The tags of the resource.
func (o GetDBClustersResultOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v GetDBClustersResult) map[string]interface{} { return v.Tags }).(pulumi.MapOutput)
}
func (o GetDBClustersResultOutput) TotalCount() pulumi.IntOutput {
return o.ApplyT(func(v GetDBClustersResult) int { return v.TotalCount }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(GetDBClustersResultOutput{})
}